Skip to contentSkip to conversation

do not reset no_shutdown after we shutdown the vm

PATCH Applied Wen Congyang 2 participants 2 messages Jun 17, 2011 – Jul 23, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 do not reset no_shutdown after we shutdown the vm

Daniel P. Berrange sent a libvirt's patch to support reboots with the QEMU driver. He implements it in json model like this:
1. add -no-shutdown in the qemu's option:
qemu -no-shutdown xxxx
2. shutdown the vm by monitor command system_powerdown
3. wait for shutdown event
4. reset the vm by monitor command system_reset

no_shutdown will be reset to 0 if the vm is powered down. We only can reboot the vm once.

If no_shutdown is not reset to 0, we can reboot the vm many times.

---
 vl.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
vl.c +0 -1
index dbdec71..e2e52ec 100644
@@ -1396,7 +1396,6 @@ static void main_loop(void)
             monitor_protocol_event(QEVENT_SHUTDOWN, NULL);
             if (no_shutdown) {
                 vm_stop(VMSTOP_SHUTDOWN);
-                no_shutdown = 0;
             } else
                 break;
         }
Signature · 1 line
1.7.1
#1 lore raw
Quoted 9 lines · Wen Congyang

Daniel P. Berrange sent a libvirt's patch to support reboots with the QEMU driver. He implements it in json model like this:
1. add -no-shutdown in the qemu's option:
qemu -no-shutdown xxxx
2. shutdown the vm by monitor command system_powerdown
3. wait for shutdown event
4. reset the vm by monitor command system_reset

Quoted 7 lines

no_shutdown will be reset to 0 if the vm is powered down. We only can reboot the vm once.

If no_shutdown is not reset to 0, we can reboot the vm many times.

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 17 lines
---
  vl.c |    1 -
  1 files changed, 0 insertions(+), 1 deletions(-)
vl.c +0 -1
index dbdec71..e2e52ec 100644
@@ -1396,7 +1396,6 @@ static void main_loop(void)
              monitor_protocol_event(QEVENT_SHUTDOWN, NULL);
              if (no_shutdown) {
                  vm_stop(VMSTOP_SHUTDOWN);
-                no_shutdown = 0;
              } else
                  break;
          }