History | View | Annotate | Download (20.4 kB)
migration: restrict scope of incoming fd read handler
The incoming migration is processed in a coroutine and uses an fd readhandler to enter the yielded coroutine when data becomes available.
The read handler was set too broadly, so that spurious coroutine entries...
error: Strip trailing '\n' from error string arguments (again)
Commit 6daf194d and be62a2eb got rid of a bunch, but they keep comingback. Tracked down with this Coccinelle semantic patch:
r expression err, eno, cls, fmt; position p; @@ (...
r
migration: Add buffered_flush error handling
Now that we have error handling we can do proper handling ofbuffered_flush().
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Reviewed-by: Eric Blake <eblake@redhat.com>Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
migration: move exit condition to migration thread
migration: unfold rest of migrate_fd_put_ready() into thread
This will allow us finer control in next patches.
migration: Only go to the iterate stage if there is anything to send
Signed-off-by: Orit Wasserman <owasserm@redhat.com>Signed-off-by: Juan Quintela <quintela@redhat.com>
migration: remove argument to qemu_savevm_state_cancel
migration: move beginning stage to the migration thread
migration: make function static
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Reviewed-by: Eric Blake <eblake@redhat.com>
migration: remove double call to migrate_fd_close
The call in buffered_close is enough, because buffered_close is calledalready by migrate_fd_cleanup.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Juan Quintela <quintela@redhat.com>...
migration: fix off-by-one in buffered_rate_limit
use XFER_LIMIT_RATIO consistently
commit 5b4e1eb769eee892b44d3f6b2369b05196442f59
missed this use.
migration: fix qemu_get_fd for BufferedFile
Not really used, but nice to have it correct. :)
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 duringmigration.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
migration: add XFER_LIMIT_RATIO
The "magic" divisions by 10 are there because of the value of BUFFER_DELAY.Introduce a constant to explain them better.
migration: move migration_fd_put_ready()
Put it near its use and un-export it.
migration: Inline qemu_fopen_ops_buffered into migrate_fd_connect
migration: move migration notifier
At this point, it is waranteed that state is ACTIVE. Old positiondidn't assured hat.
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.
migration: make qemu_fopen_ops_buffered() return void
We want the file assignment to happen before the thread is created toavoid locking, so we just do it before creating the thread.
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
migration: move migration thread init code to migrate_fd_put_ready
This way everything related with migration is run on the migrationthread and no locking is needed.
migration: make writes blocking
Move all the writes to the migration_thread, and make writingsblocking. Notice that are still using the iothread for everythingthat we do.
migration: remove unfreeze logic
Now that we have a thread, and blocking writes, we don't need it.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
migration: just lock migrate_fd_put_ready
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...
softmmu: move include files to include/sysemu/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
misc: move include files to include/qemu/
monitor: move include files to include/monitor/
migration: move include files to include/migration/
block: move include files to include/block/
migration: move process_incoming_migration to a coroutine
The final part of incoming migration, which now consists ofprocess_incoming_migration for all protocols, is thus made non-blocking.
Reviewed-by: Orit Wasserman <owasserm@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
migration: use migrate_fd_close in migrate_fd_cleanup
migrate_fd_cleanup will usually close the file descriptor viabuffered_file_close's call to migrate_fd_close. However, in the caseof s->file == NULL it is "inlining" migrate_fd_close (almost: there is a...
migration: move qemu_fclose to process_incoming_migration
The common suffix is now just process_incoming_migration.
Merge branch 'queue/qmp' of git://repo.or.cz/qemu/qmp-unstable
migration: go to paused state after finishing incoming migration with -S
At the end of migration the machine has started already, and cannot bedestroyed without losing the guest's data. Hence, prelaunch is thewrong state. Go to the paused state instead. QEMU would reach that...
migration: centralize call to migrate_fd_error()
The call to migrate_fd_error() was missing for non-socket backends, socentralize it in qmp_migrate().
Before:
(qemu) migrate fd:ffff migrate: An undefined error has occurred (qemu) info migrate...
migration: use qemu-sockets to establish Unix sockets
This makes migration-unix.c again a cut-and-paste job from migration-tcp.c,exactly as it was in the beginning. :)
migration (outgoing): add error propagation for all protocols
Error propagation is already there for socket backends. Add it to otherprotocols, simplifying code that tests for errors that will never happen.With all protocols understanding Error, the code can be simplified...
migration (incoming): add error propagation to fd and exec protocols
And remove the superfluous integer return value.
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
migration: avoid using error_is_set and thus relying on errp != NULL
The migration code is using errp to detect "internal" errors, this meansthat it relies on errp being non-NULL.
No impact so far because our only QMP clients (the QMP marshaller and HMP)...
savevm: make qemu_file_put_notify() return errors
buffered_file: unfold migrate_fd_wait_for_unfreeze
We only used it once, just remove the callback indirection.
buffered_file: unfold migrate_fd_close
buffered_file: We can access directly to bandwidth_limit
migration: make migrate_fd_wait_for_unfreeze() return errors
Adjust all callers
migration: store end_time in a local variable
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Orit Wasserman <owasserm@redhat.com>
migration: print total downtime for final phase of migration
migration: export migrate_get_current()
migration: print expected downtime in info migrate
migration: Add dirty_pages_rate to query migrate output
It indicates how many pages were dirtied during the last second.
buffered_file: unfold migrate_fd_put_buffer
We only used it once, just remove the callback indirection
buffered_file: unfold migrate_fd_put_ready
We only use it once, just remove the callback indirection.
Clear handler only for valid fd
Signed-off-by: Orit Wasserman <owasserm@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
migration: move total_time from ram stats to migration info
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Add XBZRLE to ram_save_block and ram_save_live
In the outgoing migration check to see if the page is cached andchanged, then send compressed page by using save_xbrle_page function.In the incoming migration check to see if RAM_SAVE_FLAG_XBZRLE is setand decompress the page (by using load_xbrle function)....
Add migrate_set_cache_size command
Change XBZRLE cache size in bytes (the size should be a power of 2, it will berounded down to the nearest power of 2).If XBZRLE cache size is too small there will be many cache miss.
New query-migrate-cache-size QMP command and 'info migrate_cache_size' HMP...
Add migration accounting for normal and duplicate pages
Signed-off-by: Benoit Hudzia <benoit.hudzia@sap.com>Signed-off-by: Petter Svard <petters@cs.umu.se>Signed-off-by: Aidan Shribman <aidan.shribman@sap.com>Signed-off-by: Orit Wasserman <owasserm@redhat.com>...
Add XBZRLE statistics
Signed-off-by: Benoit Hudzia <benoit.hudzia@sap.com>Signed-off-by: Petter Svard <petters@cs.umu.se>Signed-off-by: Aidan Shribman <aidan.shribman@sap.com>Signed-off-by: Orit Wasserman <owasserm@redhat.com>Signed-off-by: Juan Quintela <quintela@redhat.com>...
Add migration capabilities
The management can query the current migration capabilities usingquery-migrate-capabilities QMP command.The user can use 'info migrate_capabilities' HMP command.Currently only XBZRLE capability is available.
Signed-off-by: Orit Wasserman <owasserm@redhat.com>...
Add migrate-set-capabilities
The management can enable/disable a capability for the next migration by usingmigrate-set-capabilities QMP command.The user can use migrate_set_capability HMP command.
Signed-off-by: Orit Wasserman <owasserm@redhat.com>Signed-off-by: Juan Quintela <quintela@redhat.com>...
Add spent time for migration
We add time spent for migration to the output of "info migrate" command. 'total_time' means time since the start fo migration ifmigration is 'active', and total time of migration if migration iscompleted. As we are also interested in transferred ram when...
Add MigrationParams structure
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
use inet_listen()/inet_connect() to support ipv6 migration
Use help functions in qemu-socket.c for tcp migration,which already support ipv6 addresses.
Currently errp will be set to UNDEFINED_ERROR when migration fails,qemu would output "migration failed: ...", and current user can...
wakeup on migration
Wakeup the guest when the live part of the migation is finished.This avoids being in suspended state on migration, so we don'thave to save the is_suspended bit.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
migration: clear BDRV_O_INCOMING flags on end of incoming live migration
Signed-off-by: Benoît Canet <benoit.canet@gmail.com>Reviewed-by: Stefan Hajnoczi <stefanha@gmail.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Purge migration of (almost) everything to do with monitors
The Monitor object is passed back and forth within the migration/savevmcode so that it can print errors and progress to the user.
However, that approach assumes a HMP monitor, being completely invalid...
qapi: Convert migrate
The migrate command is one of those commands where HMP and QMP completelymix up together. This made the conversion to the QAPI (which separates thecommand into QMP and HMP parts) a bit difficult.
The first important change to be noticed is that this commit completes the...
notifier: switch to QLIST
Notifiers do not need to access both ends of the list, and usinga QLIST also simplifies the API.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
prepare for future GPLv2+ relicensing
All files under GPLv2 will get GPLv2+ changes starting tomorrow.event_notifier.c and exec-obsolete.h were only ever touched by Red Hatemployees and can be relicensed now.
migrate_fd_cleanup: accept any negative qemu_fclose() value as error
Also, we now return the qemu_fclose() value unchanged to the caller. Forreference, the migrate_fd_cleanup() callers are the following:
- migrate_fd_completed(): any negative value is considered an...
qapi: Convert migrate_cancel
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
qapi: Convert migrate_set_downtime
qapi: Convert migrate_set_speed
block: allow migration to work with image files (v3)
Image files have two types of data: immutable data that describes things likeimage size, backing files, etc. and mutable data that includes offset andreference count tables.
Today, image formats aggressively cache mutable data to improve performance. In...
migrate: add migration blockers
This lets different subsystems register an Error that is thrown whenevermigration is attempted. This works nicely because it gracefully supportsthings like hotplug.
Right now, if multiple errors are registered, only one of them is reported....
migration: fix detached migration with fd
Migration with fd uses s->mon to pass the fd. But we only assign thes->mon for !detached migration. Fix it. Once there add a commentindicating that s->mon has two uses.
Bug reported by: Wen Congyang <wency@cn.fujitsu.com>...
Fix segfault on migration completion
A simple migration reproduces it:
1. Start the source VM with:
2. Start the destination VM with:
3. In the source VM:
(qemu) migrate -d tcp:0:4444...
Merge remote-tracking branch 'qmp/queue/qmp' into staging
Conflicts: ui/spice-core.c
qapi: Convert query-migrate
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
migration: add status query functions
Add migration_is_active and migration_has_failed functionsto query migration state.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Merge remote-tracking branch 'quintela/migration-pull' into staging
migration: Remove get_status() accessor
It is only used inside migration.c, and fields on that struct areaccessed all around the place on that file.
migration: Remove migration cancel() callback
It is used only in one place
migration: Move exported functions to the end of the file
This means we can remove the two forward declarations.
Signed-off-by: Juan Quintela <quintela@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
migration: create accessor for current_migration
migration: Use bandwidth_limit directly
Now that current_migration always exist, there is no reason formax_throotle variable.
migration: Pass MigrationState in migration notifiers
migration: Export a function that tells if the migration has finished correctly
This will allow us to hide the state values.
migration: Make state definitions local
migration: Fold MigrationState into FdMigrationState
migration: Rename FdMigrationState MigrationState
migration: Refactor MigrationState creation
migration: Make all posible migration functions static
I have to move two functions postions to avoid forward declarations
migration: move migrate_new to do_migrate
Once there, remove all parameters that don't need to be passed to*start_outgoing_migration() functions
migration: Introduce MIG_STATE_SETUP
Use MIG_STATE_ACTIVE only when migration has really started. Use thisnew state to setup migration parameters. Change defines for ananonymous struct.
migration: Refactor and simplify error checking in migrate_fd_put_ready
migration: Introduce migrate_fd_completed() for consistency
This function is a bit different of the others that change the state,in the sense that if migrate_fd_cleanup() returns an error, it set thestatus to error, not completed.
migration: Our release callback was just free
We called it from a single place, and always with state !=MIG_STATE_ACTIVE. Just remove the whole callback. For users of thenotifier, notice that this is exactly the case where they don't care,we are just freeing the state from previous failed migration (it can't...
migration: Use FdMigrationState instead of MigrationState when possible