Skip to content

Commit

Permalink
QMP: Introduce RESUME event
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
  • Loading branch information
Luiz Capitulino authored and Anthony Liguori committed May 3, 2010
1 parent 3d54abc commit 6ed2c48
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions QMP/qmp-events.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------

Expand Down
3 changes: 3 additions & 0 deletions monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions monitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ typedef enum MonitorEvent {
QEVENT_RESET,
QEVENT_POWERDOWN,
QEVENT_STOP,
QEVENT_RESUME,
QEVENT_VNC_CONNECTED,
QEVENT_VNC_INITIALIZED,
QEVENT_VNC_DISCONNECTED,
Expand Down
1 change: 1 addition & 0 deletions vl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 6ed2c48

Please sign in to comment.