mirror of
https://github.com/mii443/qemu.git
synced 2025-08-26 00:49:39 +00:00
honor -S on incoming migration
-S is not honored by qemu on incoming migration. If a domain is migrated while paused, thus, it will start running on the remote machine; this is wrong. Given the trivial patch to fix this, it looks more like a thinko than anything else, probably dating back to the qemu-kvm merge. The interesting part is that the -S mechanism was in fact *used* when migrating (setting autostart = 0) and the incoming migration code was starting the VM at the end of the migration. Since I was removing the vm_start from there, I also corrected a related imprecision. The code was doing a vm_stop "just in case", but we can be sure that the VM is not running---the vm_start call in vl.c has not been reached yet. So the vm_stop is removed together with the vm_start. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
committed by
Anthony Liguori
parent
cc15f92832
commit
df97ff696b
@ -113,7 +113,6 @@ static void exec_accept_incoming_migration(void *opaque)
|
|||||||
QEMUFile *f = opaque;
|
QEMUFile *f = opaque;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
vm_stop(0); /* just in case */
|
|
||||||
ret = qemu_loadvm_state(f);
|
ret = qemu_loadvm_state(f);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
fprintf(stderr, "load of migration failed\n");
|
fprintf(stderr, "load of migration failed\n");
|
||||||
@ -123,7 +122,6 @@ static void exec_accept_incoming_migration(void *opaque)
|
|||||||
dprintf("successfully loaded vm state\n");
|
dprintf("successfully loaded vm state\n");
|
||||||
/* we've successfully migrated, close the fd */
|
/* we've successfully migrated, close the fd */
|
||||||
qemu_set_fd_handler2(qemu_popen_fd(f), NULL, NULL, NULL, NULL);
|
qemu_set_fd_handler2(qemu_popen_fd(f), NULL, NULL, NULL, NULL);
|
||||||
vm_start();
|
|
||||||
|
|
||||||
err:
|
err:
|
||||||
qemu_fclose(f);
|
qemu_fclose(f);
|
||||||
|
@ -159,7 +159,6 @@ static void tcp_accept_incoming_migration(void *opaque)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
vm_stop(0); /* just in case */
|
|
||||||
ret = qemu_loadvm_state(f);
|
ret = qemu_loadvm_state(f);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
fprintf(stderr, "load of migration failed\n");
|
fprintf(stderr, "load of migration failed\n");
|
||||||
@ -172,8 +171,6 @@ static void tcp_accept_incoming_migration(void *opaque)
|
|||||||
qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL);
|
qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL);
|
||||||
close(s);
|
close(s);
|
||||||
|
|
||||||
vm_start();
|
|
||||||
|
|
||||||
out_fopen:
|
out_fopen:
|
||||||
qemu_fclose(f);
|
qemu_fclose(f);
|
||||||
out:
|
out:
|
||||||
|
4
vl.c
4
vl.c
@ -5721,10 +5721,8 @@ int main(int argc, char **argv, char **envp)
|
|||||||
if (loadvm)
|
if (loadvm)
|
||||||
do_loadvm(loadvm);
|
do_loadvm(loadvm);
|
||||||
|
|
||||||
if (incoming) {
|
if (incoming)
|
||||||
autostart = 0; /* fixme how to deal with -daemonize */
|
|
||||||
qemu_start_incoming_migration(incoming);
|
qemu_start_incoming_migration(incoming);
|
||||||
}
|
|
||||||
|
|
||||||
if (autostart)
|
if (autostart)
|
||||||
vm_start();
|
vm_start();
|
||||||
|
Reference in New Issue
Block a user