return r;
}
-static RunState qemu_vmstop_requested(void)
+static bool qemu_vmstop_requested(RunState *r)
{
- RunState s = vmstop_requested;
- vmstop_requested = RSTATE_NO_STATE;
- return s;
+ if (vmstop_requested != RSTATE_NO_STATE) {
+ *r = vmstop_requested;
+ vmstop_requested = RSTATE_NO_STATE;
+ return true;
+ }
+
+ return false;
}
void qemu_register_reset(QEMUResetHandler *func, void *opaque)
#ifdef CONFIG_PROFILER
int64_t ti;
#endif
- int r;
+ RunState r;
qemu_main_loop_start();
monitor_protocol_event(QEVENT_POWERDOWN, NULL);
qemu_irq_raise(qemu_system_powerdown);
}
- if ((r = qemu_vmstop_requested())) {
+ if (qemu_vmstop_requested(&r)) {
vm_stop(r);
}
}