qemu-e2k/include
Juan Quintela e4ed1541ac savevm: New save live migration method: pending
Code just now does (simplified for clarity)

    if (qemu_savevm_state_iterate(s->file) == 1) {
       vm_stop_force_state(RUN_STATE_FINISH_MIGRATE);
       qemu_savevm_state_complete(s->file);
    }

Problem here is that qemu_savevm_state_iterate() returns 1 when it
knows that remaining memory to sent takes less than max downtime.

But this means that we could end spending 2x max_downtime, one
downtime in qemu_savevm_iterate, and the other in
qemu_savevm_state_complete.

Changed code to:

    pending_size = qemu_savevm_state_pending(s->file, max_size);
    DPRINTF("pending size %lu max %lu\n", pending_size, max_size);
    if (pending_size >= max_size) {
        ret = qemu_savevm_state_iterate(s->file);
     } else {
        vm_stop_force_state(RUN_STATE_FINISH_MIGRATE);
        qemu_savevm_state_complete(s->file);
     }

So what we do is: at current network speed, we calculate the maximum
number of bytes we can sent: max_size.

Then we ask every save_live section how much they have pending.  If
they are less than max_size, we move to complete phase, otherwise we
do an iterate one.

This makes things much simpler, because now individual sections don't
have to caluclate the bandwidth (it was implossible to do right from
there).

Signed-off-by: Juan Quintela <quintela@redhat.com>

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-20 23:09:25 +01:00
..
block misc: move include files to include/qemu/ 2012-12-19 08:32:39 +01:00
bt softmmu: move remaining include files to include/ subdirectories 2012-12-19 08:32:46 +01:00
char softmmu: move remaining include files to include/ subdirectories 2012-12-19 08:32:46 +01:00
disas build: kill libdis, move disassemblers to disas/ 2012-12-19 08:29:06 +01:00
exec protect the ramlist with a separate mutex 2012-12-20 23:08:47 +01:00
fpu fpu: move public header file to include/fpu 2012-12-19 08:32:46 +01:00
migration savevm: New save live migration method: pending 2012-12-20 23:09:25 +01:00
monitor monitor: move include files to include/monitor/ 2012-12-19 08:31:32 +01:00
net misc: move include files to include/qemu/ 2012-12-19 08:32:39 +01:00
qapi misc: move include files to include/qemu/ 2012-12-19 08:32:39 +01:00
qemu fpu: move public header file to include/fpu 2012-12-19 08:32:46 +01:00
qom misc: move include files to include/qemu/ 2012-12-19 08:32:39 +01:00
sysemu savevm: New save live migration method: pending 2012-12-20 23:09:25 +01:00
ui Merge remote-tracking branch 'bonzini/header-dirs' into staging 2012-12-19 17:15:39 -06:00
config.h janitor: move remaining public headers to include/ 2012-12-19 08:32:46 +01:00
elf.h janitor: move remaining public headers to include/ 2012-12-19 08:32:46 +01:00
libfdt_env.h janitor: move remaining public headers to include/ 2012-12-19 08:32:46 +01:00
qemu-common.h janitor: move remaining public headers to include/ 2012-12-19 08:32:46 +01:00