savevm: qemu_savevm_state(): Drop stop VM logic
PATCH 1/1 savevm: qemu_savevm_state(): Drop stop VM logic
qemu_savevm_state() has some logic to stop the VM and to (or not to) resume it. But this seems to be a big noop, as qemu_savevm_state() is only called by do_savevm() when the VM is already stopped.
So, let's drop qemu_savevm_state()'s stop VM logic.
--- savevm.c | 7 ------- 1 files changed, 0 insertions(+), 7 deletions(-)
savevm.c +0 -7
@@ -1599,12 +1599,8 @@ void qemu_savevm_state_cancel(Monitor *mon, QEMUFile *f)static int qemu_savevm_state (Monitor *mon,QEMUFile *f) { -int saved_vm_running;int ret; - saved_vm_running =runstate_is_running (); -vm_stop (RUN_STATE_SAVE_VM ); -if (qemu_savevm_state_blocked (mon)) { ret = -EINVAL ; goto out;
@@ -1626,9 +1622,6 @@ out:if (qemu_file_has_error (f)) ret = -EIO ; -if (!ret && saved_vm_running) -vm_start (); -return ret; }
Signature · 1 line
1.7.7.rc3
Heh, Anthony and I were puzzling over this just before your patch hit the list.
Looks good :)
Quoted 42 lines · Luiz Capitulino
qemu_savevm_state()has some logic to stop the VM and to (or not to) resume it. But this seems to be a big noop, asqemu_savevm_state()is only called bydo_savevm()when the VM is already stopped.So, let's drop qemu_savevm_state()'s stop VM logic.
Signed-off-by Luiz Capitulino <[email protected]>--- savevm.c | 7 ------- 1 files changed, 0 insertions(+), 7 deletions(-)savevm.c +0
-7@@ -1599,12 +1599,8 @@ void qemu_savevm_state_cancel(Monitor *mon, QEMUFile *f)static int qemu_savevm_state (Monitor *mon,QEMUFile *f) { -int saved_vm_running;int ret; - saved_vm_running =runstate_is_running (); -vm_stop (RUN_STATE_SAVE_VM ); -if (qemu_savevm_state_blocked (mon)) { ret = -EINVAL ; goto out;@@ -1626,9 +1622,6 @@ out:if (qemu_file_has_error (f)) ret = -EIO ; -if (!ret && saved_vm_running) -vm_start (); -return ret; }Signature · 1 line
1.7.7.rc3
Signature · 3 lines
Sincerely, Mike Roth IBM Linux Technology Center
Am 13.10.2011 22:27, schrieb Luiz Capitulino:
Quoted 7 lines
qemu_savevm_state()has some logic to stop the VM and to (or not to) resume it. But this seems to be a big noop, asqemu_savevm_state()is only called bydo_savevm()when the VM is already stopped.So, let's drop qemu_savevm_state()'s stop VM logic.
Signed-off-by Luiz Capitulino <[email protected]>
Quoted 7 lines · Luiz Capitulino
qemu_savevm_state()has some logic to stop the VM and to (or not to) resume it. But this seems to be a big noop, asqemu_savevm_state()is only called bydo_savevm()when the VM is already stopped.So, let's drop qemu_savevm_state()'s stop VM logic.
Signed-off-by Luiz Capitulino <[email protected]>