aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2010-04-27 20:35:59 -0300
committerAnthony Liguori <aliguori@us.ibm.com>2010-05-03 12:39:12 -0500
commit6ed2c484f261fd8bd217f855b9e5e5f981e63f0a (patch)
treee95efe58f55934530619e1ff4a7941d54fa3981a
parent3d54abc7b7f234685ea48bdd1743ed631cf02ba0 (diff)
QMP: Introduce RESUME event
It's emitted when the Virtual Machine resumes execution. We currently have the STOP event but don't have the matching RESUME one, this means that clients are notified when the VM is stopped but don't get anything when it resumes. Let's fix that as it's already causing some trouble to libvirt. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r--QMP/qmp-events.txt12
-rw-r--r--monitor.c3
-rw-r--r--monitor.h1
-rw-r--r--vl.c1
4 files changed, 17 insertions, 0 deletions
diff --git a/QMP/qmp-events.txt b/QMP/qmp-events.txt
index c084a47309..01ec85fbb9 100644
--- a/QMP/qmp-events.txt
+++ b/QMP/qmp-events.txt
@@ -38,6 +38,18 @@ Example:
{ "event": "RESET",
"timestamp": { "seconds": 1267041653, "microseconds": 9518 } }
+RESUME
+------
+
+Emitted when the Virtual Machine resumes execution.
+
+Data: None.
+
+Example:
+
+{ "event": "RESUME",
+ "timestamp": { "seconds": 1271770767, "microseconds": 582542 } }
+
RTC_CHANGE
----------
diff --git a/monitor.c b/monitor.c
index 754bcc5cc0..bb87479f58 100644
--- a/monitor.c
+++ b/monitor.c
@@ -423,6 +423,9 @@ void monitor_protocol_event(MonitorEvent event, QObject *data)
case QEVENT_STOP:
event_name = "STOP";
break;
+ case QEVENT_RESUME:
+ event_name = "RESUME";
+ break;
case QEVENT_VNC_CONNECTED:
event_name = "VNC_CONNECTED";
break;
diff --git a/monitor.h b/monitor.h
index 5bdeed101a..ea15469f25 100644
--- a/monitor.h
+++ b/monitor.h
@@ -21,6 +21,7 @@ typedef enum MonitorEvent {
QEVENT_RESET,
QEVENT_POWERDOWN,
QEVENT_STOP,
+ QEVENT_RESUME,
QEVENT_VNC_CONNECTED,
QEVENT_VNC_INITIALIZED,
QEVENT_VNC_DISCONNECTED,
diff --git a/vl.c b/vl.c
index 9caf96d399..999aac8cc5 100644
--- a/vl.c
+++ b/vl.c
@@ -1689,6 +1689,7 @@ void vm_start(void)
vm_running = 1;
vm_state_notify(1, 0);
resume_all_vcpus();
+ monitor_protocol_event(QEVENT_RESUME, NULL);
}
}