]> xenbits.xensource.com Git - libvirt.git/commit
event: pass reason for PM events
authorEric Blake <eblake@redhat.com>
Wed, 29 Jan 2014 00:41:34 +0000 (17:41 -0700)
committerEric Blake <eblake@redhat.com>
Wed, 12 Feb 2014 17:48:16 +0000 (10:48 -0700)
commit6831c1d32735c3cf80b118ba861156028e3627f6
treeb2eb1d572a71f806b410c0452cec1dc5ba725754
parent158795d20ea0ae928feb8a3691e6d8340cb8a92a
event: pass reason for PM events

Commit 57ddcc23 (v0.9.11) introduced the pmwakeup event, with
an optional 'reason' field reserved for possible future expansion.
But it failed to wire the field through RPC, so even if we do
add a reason in the future, we will be unable to get it back
to the user.

Worse, commit 7ba5defb (v1.0.0) repeated the same mistake with
the pmsuspend_disk event.

As long as we are adding new RPC calls, we might as well fix
the events to actually match the signature so that we don't have
to add yet another RPC in the future if we do decide to start
using the reason field.

* src/remote/remote_protocol.x
(remote_domain_event_callback_pmwakeup_msg)
(remote_domain_event_callback_pmsuspend_msg)
(remote_domain_event_callback_pmsuspend_disk_msg): Add reason
field.
* daemon/remote.c (remoteRelayDomainEventPMWakeup)
(remoteRelayDomainEventPMSuspend)
(remoteRelayDomainEventPMSuspendDisk): Pass reason to client.
* src/conf/domain_event.h (virDomainEventPMWakeupNewFromDom)
(virDomainEventPMSuspendNewFromDom)
(virDomainEventPMSuspendDiskNewFromDom): Require additional
parameter.
* src/conf/domain_event.c (virDomainEventPMClass): New class.
(virDomainEventPMDispose): New function.
(virDomainEventPMWakeupNew*, virDomainEventPMSuspendNew*)
(virDomainEventPMSuspendDiskNew*)
(virDomainEventDispatchDefaultFunc): Use new class.
* src/remote/remote_driver.c (remoteDomainBuildEvent*PM*): Pass
reason through.
* src/remote_protocol-structs: Regenerate.

Signed-off-by: Eric Blake <eblake@redhat.com>
daemon/remote.c
src/conf/domain_event.c
src/conf/domain_event.h
src/remote/remote_driver.c
src/remote/remote_protocol.x
src/remote_protocol-structs