mirror of https://github.com/xemu-project/xemu.git
migration: Don't activate block devices if using -S
Activating the block devices causes the locks to be taken on the backing file. If we're running with -S and the destination libvirt hasn't started the destination with 'cont', it's expecting the locks are still untaken. Don't activate the block devices if we're not going to autostart the VM; 'cont' already will do that anyway. bz: https://bugzilla.redhat.com/show_bug.cgi?id=1560854 Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20180328170207.49512-1-dgilbert@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
parent
fc6008f37a
commit
0746a92612
|
@ -306,13 +306,21 @@ static void process_incoming_migration_bh(void *opaque)
|
||||||
Error *local_err = NULL;
|
Error *local_err = NULL;
|
||||||
MigrationIncomingState *mis = opaque;
|
MigrationIncomingState *mis = opaque;
|
||||||
|
|
||||||
/* Make sure all file formats flush their mutable metadata.
|
/* Only fire up the block code now if we're going to restart the
|
||||||
* If we get an error here, just don't restart the VM yet. */
|
* VM, else 'cont' will do it.
|
||||||
bdrv_invalidate_cache_all(&local_err);
|
* This causes file locking to happen; so we don't want it to happen
|
||||||
if (local_err) {
|
* unless we really are starting the VM.
|
||||||
error_report_err(local_err);
|
*/
|
||||||
local_err = NULL;
|
if (autostart && (!global_state_received() ||
|
||||||
autostart = false;
|
global_state_get_runstate() == RUN_STATE_RUNNING)) {
|
||||||
|
/* Make sure all file formats flush their mutable metadata.
|
||||||
|
* If we get an error here, just don't restart the VM yet. */
|
||||||
|
bdrv_invalidate_cache_all(&local_err);
|
||||||
|
if (local_err) {
|
||||||
|
error_report_err(local_err);
|
||||||
|
local_err = NULL;
|
||||||
|
autostart = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue