Statistics
| Branch: | Revision:

root / include / migration @ d58f5598

# Date Author Comment
d58f5598 03/26/2013 02:30 pm David Gibson

savevm: Add VMSTATE_UINTTL_EQUAL helper

This adds an _EQUAL VMSTATE helper for target_ulongs, defined in terms of
VMSTATE_UINT32_EQUAL or VMSTATE_UINT64_EQUAL as appropriate.

Signed-off-by: David Gibson <>
Signed-off-by: Juan Quintela <>

e344b8a1 03/26/2013 02:30 pm David Gibson

savevm: Add VMSTATE_UINT64_EQUAL helpers

The savevm code already includes a number of *_EQUAL helpers which act as
sanity checks verifying that the configuration of the saved state matches
that of the machine we're loading into to work. Variants already exist...

d7650eab 03/12/2013 11:35 am Andreas Färber

vmstate: Make vmstate_register() static inline

This avoids adding a duplicate stub for CONFIG_USER_ONLY.

Suggested-by: Eduardo Habkost <>
Reviewed-by: Eduardo Habkost <>
Reviewed-by: Juan Quintela <>...

c71c3e99 03/12/2013 11:35 am Andreas Färber

stubs: Add a vmstate_dummy struct for CONFIG_USER_ONLY

Reviewed-by: Juan Quintela <>
Reviewed-by: Eduardo Habkost <>
Signed-off-by: Andreas Färber <>

b352365f 03/11/2013 02:32 pm Paolo Bonzini

migration: eliminate s->migration_file

The indirection is useless now. Backends can open s->file directly.

Reviewed-by: Orit Wasserman <>
Reviewed-by: Juan Quintela <>
Signed-off-by: Paolo Bonzini <>...

ee0b44aa 03/11/2013 02:32 pm Peter Lieven

page_cache: dup memory on insert

The page cache frees all data on finish, on resize and
if there is collision on insert. So it should be the caches
responsibility to dup the data that is stored in the cache.

Signed-off-by: Peter Lieven <>
Signed-off-by: Orit Wasserman <>...

edaae611 03/11/2013 02:32 pm Paolo Bonzini

migration: yay, buffering is gone

Buffering was needed because blocking writes could take a long time
and starve other threads seeking to grab the big QEMU mutex.

Now that all writes (except within _complete callbacks) are done
outside the big QEMU mutex, we do not need buffering at all....

05f28b83 03/11/2013 02:32 pm Paolo Bonzini

qemu-file: make qemu_fflush and qemu_file_set_error private again

Reviewed-by: Orit Wasserman <>
Reviewed-by: Juan Quintela <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Juan Quintela <>

817b9ed5 03/11/2013 02:32 pm Paolo Bonzini

migration: merge qemu_popen_cmd with qemu_popen

There is no reason for outgoing exec migration to do popen manually
anymore (the reason used to be that we needed the FILE* to make it
non-blocking). Use qemu_popen_cmd.

Reviewed-by: Orit Wasserman <>...

0cc3f3cc 03/11/2013 02:32 pm Paolo Bonzini

qemu-file: add writable socket QEMUFile

Reviewed-by: Orit Wasserman <>
Reviewed-by: Juan Quintela <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Juan Quintela <>

f8bbc128 03/11/2013 02:32 pm Paolo Bonzini

migration: use QEMUFile for migration channel lifetime

As a start, use QEMUFile to store the destination and close it.
qemu_get_fd gets a file descriptor that will be used by the write
callbacks.

Reviewed-by: Orit Wasserman <>
Reviewed-by: Juan Quintela <>...

e6a1cf21 03/11/2013 02:32 pm Paolo Bonzini

migration: use QEMUFile for writing outgoing migration data

Second, drop the file descriptor indirection, and write directly to the
QEMUFile.

Reviewed-by: Orit Wasserman <>
Reviewed-by: Juan Quintela <>
Signed-off-by: Paolo Bonzini <>...

1964a397 03/11/2013 02:32 pm Paolo Bonzini

migration: move rate limiting to QEMUFile

Rate limiting is now simply a byte counter; client call
qemu_file_rate_limit() manually to determine if they have to exit.
So it is possible and simple to move the functionality to QEMUFile.

This makes the remaining functionality of s->file redundant;...

4eb93810 03/11/2013 02:32 pm Paolo Bonzini

qemu-file: temporarily expose qemu_file_set_error and qemu_fflush

Right now, migration cannot entirely rely on QEMUFile's automatic
drop of I/O after an error, because it does its "real" I/O outside
the put_buffer callback. To fix this until buffering is gone, expose...

dba433c0 03/11/2013 02:32 pm Paolo Bonzini

migration: simplify error handling

Always use qemu_file_get_error to detect errors, since that is how
QEMUFile itself drops I/O after an error occurs. There is no need
to propagate and check return values all the time.

Also remove the "complete" member, since we know that it is set (via...

bb1fadc4 03/11/2013 02:32 pm Paolo Bonzini

migration: cleanup migration (including thread) in the iothread

Perform final cleanup in a bottom half, and add joining the thread to
the series of cleanup actions.

migrate_fd_error remains for connection error, but it doesn't need
to cleanup anything anymore....

8c8de19d 03/11/2013 02:32 pm Paolo Bonzini

migration: reorder SaveVMHandlers members

This groups together the callbacks that later will have similar
locking rules.

Reviewed-by: Orit Wasserman <>
Reviewed-by: Juan Quintela <>
Signed-off-by: Paolo Bonzini <>...

32c835ba 03/11/2013 02:32 pm Paolo Bonzini

migration: run pending/iterate callbacks out of big lock

This makes it possible to do blocking writes directly to the socket,
with no buffer in the middle. For RAM, only the migration_bitmap_sync()
call needs the iothread lock. For block migration, it is needed by...

9b095037 03/11/2013 02:32 pm Paolo Bonzini

migration: run setup callbacks out of big lock

Only the migration_bitmap_sync() call needs the iothread lock.

Reviewed-by: Orit Wasserman <>
Reviewed-by: Juan Quintela <>
Signed-off-by: Paolo Bonzini <>...

fd7f0d66 03/01/2013 02:53 pm Paolo Bonzini

hw: move fifo.[ch] to libqemuutil

fifo.c is generic code that can be easily unit tested. So it
belongs in libqemuutil.

Signed-off-by: Paolo Bonzini <>

90f8ae72 02/22/2013 11:12 am Juan Quintela

migration: calculate expected_downtime

We removed the calculation in commit e4ed1541ac9413eac494a03532e34beaf8a7d1c5

Now we add it back. We need to create dirty_bytes_rate because we
can't include cpu-all.h from migration.c, and there is no other way to...

ad55ab42 02/13/2013 12:26 am Stefan Hajnoczi

migration: make qemu_ftell() public and support writable files

Migration .save_live_iterate() functions return the number of bytes
transferred. The easiest way of doing this is by calling qemu_ftell(f)
at the beginning and end of the function to calculate the difference....

76f5933a 01/17/2013 02:54 pm Juan Quintela

migration: move beginning stage to the migration thread

Signed-off-by: Juan Quintela <>

Reviewed-by: Reviewed-by: Eric Blake <>
Reviewed-by: Paolo Bonzini <>

b9c961a8 01/17/2013 02:54 pm Paolo Bonzini

migration: make function static

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Juan Quintela <>

Reviewed-by: Reviewed-by: Eric Blake <>

9848a404 12/21/2012 12:09 am Juan Quintela

migration: merge QEMUFileBuffered into MigrationState

Avoid splitting the state of outgoing migration, more or less arbitrarily,
between two data structures. QEMUFileBuffered anyway is used only during
migration.

Signed-off-by: Paolo Bonzini <>...

0e288fa3 12/21/2012 12:09 am Juan Quintela

migration: move migration_fd_put_ready()

Put it near its use and un-export it.

Signed-off-by: Juan Quintela <>

2e450865 12/21/2012 12:09 am Juan Quintela

migration: Inline qemu_fopen_ops_buffered into migrate_fd_connect

Signed-off-by: Juan Quintela <>

0d82d0e8 12/21/2012 12:09 am Juan Quintela

migration: move buffered_file.c code into migration.c

This only moves the code (also from buffered_file.h to migration.h).
Fix whitespace until checkpatch is happy.

Signed-off-by: Juan Quintela <>

edfa1af5 12/21/2012 12:09 am Juan Quintela

migration: make qemu_fopen_ops_buffered() return void

We want the file assignment to happen before the thread is created to
avoid locking, so we just do it before creating the thread.

Signed-off-by: Juan Quintela <>

Reviewed-by: Orit Wasserman <>

766bd176 12/21/2012 12:09 am Juan Quintela

migration: move migration thread init code to migrate_fd_put_ready

This way everything related with migration is run on the migration
thread and no locking is needed.

Signed-off-by: Juan Quintela <>

dd217b87 12/21/2012 12:09 am Juan Quintela

migration: make writes blocking

Move all the writes to the migration_thread, and make writings
blocking. Notice that are still using the iothread for everything
that we do.

Signed-off-by: Juan Quintela <>

188a4285 12/21/2012 12:09 am Juan Quintela

migration: remove unfreeze logic

Now that we have a thread, and blocking writes, we don't need it.

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>

e4ed1541 12/21/2012 12:09 am Juan Quintela

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...

1de7afc9 12/19/2012 09:32 am Paolo Bonzini

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>

caf71f86 12/19/2012 09:31 am Paolo Bonzini

migration: move include files to include/migration/

Signed-off-by: Paolo Bonzini <>