mirror of
https://github.com/qemu/qemu.git
synced 2024-12-18 17:53:40 +08:00
Revert "migration: don't account sleep time for calculating bandwidth"
This reverts commit7161082c8d
. Reverting this patch fixes a divide-by-zero error in qemu that can be fairly reliably triggered by doing block migration. In this case, the configuration/error was: source: temp/x86_64-softmmu/qemu-system-x86_64 -enable-kvm -L temp-bios -M pc-i440fx-1.4 -m 512M -kernel boot/vmlinuz-x86_64 -initrd boot/test-initramfs-x86_64.img.gz -vga std -append seed=1234 -drive file=disk1.img,if=virtio -drive file=disk2.img,if=virtio -device virtio-net-pci,netdev=net0 -netdev user,id=net0 -monitor unix:/tmp/vm-hmp.sock,server,nowait -qmp unix:/tmp/vm-qmp.sock,server,nowait -vnc :100 16837 Floating point exception(core dumped) target: temp/x86_64-softmmu/qemu-system-x86_64 -enable-kvm -L temp-bios -M pc-i440fx-1.4 -m 512M -kernel boot/vmlinuz-x86_64 -initrd boot/test-initramfs-x86_64.img.gz -vga std -append seed=1234 -drive file=target_disk1.img,if=virtio -drive file=target_disk2.img,if=virtio -device virtio-net-pci,netdev=net0 -netdev user,id=net0 -incoming unix:/tmp/migrate.sock -monitor unix:/tmp/vm-hmp-incoming.sock,server,nowait -qmp unix:/tmp/vm-qmp-incoming.sock,server,nowait -vnc :101 Receiving block device images 20 % 21 % load of migration failed This revert potentially re-introduces a bug that was present in 1.4, but fixes a prevalent issue with block migration so we should revert it for now and take an updated patch later. Conflicts: migration.c * fixed up to remove logic introduced in7161082c
while leaving changes in HEAD intact Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Message-id: 1368739544-31021-1-git-send-email-mdroth@linux.vnet.ibm.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
3cb8c205e3
commit
77417f1070
@ -498,7 +498,6 @@ static void *migration_thread(void *opaque)
|
|||||||
{
|
{
|
||||||
MigrationState *s = opaque;
|
MigrationState *s = opaque;
|
||||||
int64_t initial_time = qemu_get_clock_ms(rt_clock);
|
int64_t initial_time = qemu_get_clock_ms(rt_clock);
|
||||||
int64_t sleep_time = 0;
|
|
||||||
int64_t initial_bytes = 0;
|
int64_t initial_bytes = 0;
|
||||||
int64_t max_size = 0;
|
int64_t max_size = 0;
|
||||||
int64_t start_time = initial_time;
|
int64_t start_time = initial_time;
|
||||||
@ -541,7 +540,7 @@ static void *migration_thread(void *opaque)
|
|||||||
current_time = qemu_get_clock_ms(rt_clock);
|
current_time = qemu_get_clock_ms(rt_clock);
|
||||||
if (current_time >= initial_time + BUFFER_DELAY) {
|
if (current_time >= initial_time + BUFFER_DELAY) {
|
||||||
uint64_t transferred_bytes = qemu_ftell(s->file) - initial_bytes;
|
uint64_t transferred_bytes = qemu_ftell(s->file) - initial_bytes;
|
||||||
uint64_t time_spent = current_time - initial_time - sleep_time;
|
uint64_t time_spent = current_time - initial_time;
|
||||||
double bandwidth = transferred_bytes / time_spent;
|
double bandwidth = transferred_bytes / time_spent;
|
||||||
max_size = bandwidth * migrate_max_downtime() / 1000000;
|
max_size = bandwidth * migrate_max_downtime() / 1000000;
|
||||||
|
|
||||||
@ -555,14 +554,12 @@ static void *migration_thread(void *opaque)
|
|||||||
}
|
}
|
||||||
|
|
||||||
qemu_file_reset_rate_limit(s->file);
|
qemu_file_reset_rate_limit(s->file);
|
||||||
sleep_time = 0;
|
|
||||||
initial_time = current_time;
|
initial_time = current_time;
|
||||||
initial_bytes = qemu_ftell(s->file);
|
initial_bytes = qemu_ftell(s->file);
|
||||||
}
|
}
|
||||||
if (qemu_file_rate_limit(s->file)) {
|
if (qemu_file_rate_limit(s->file)) {
|
||||||
/* usleep expects microseconds */
|
/* usleep expects microseconds */
|
||||||
g_usleep((initial_time + BUFFER_DELAY - current_time)*1000);
|
g_usleep((initial_time + BUFFER_DELAY - current_time)*1000);
|
||||||
sleep_time += qemu_get_clock_ms(rt_clock) - current_time;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user