diff options
Diffstat (limited to 'src/remote/remote_driver.c')
-rw-r--r-- | src/remote/remote_driver.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 72b4b8fa3..f11e957f5 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -239,6 +239,11 @@ remoteDomainBuildEventDiskChange(virNetClientProgramPtr prog, virNetClientPtr client, void *evdata, void *opaque); +static void +remoteDomainBuildEventTrayChange(virNetClientProgramPtr prog, + virNetClientPtr client, + void *evdata, void *opaque); + static virNetClientProgramEvent remoteDomainEvents[] = { { REMOTE_PROC_DOMAIN_EVENT_RTC_CHANGE, remoteDomainBuildEventRTCChange, @@ -280,6 +285,10 @@ static virNetClientProgramEvent remoteDomainEvents[] = { remoteDomainBuildEventDiskChange, sizeof(remote_domain_event_disk_change_msg), (xdrproc_t)xdr_remote_domain_event_disk_change_msg }, + { REMOTE_PROC_DOMAIN_EVENT_TRAY_CHANGE, + remoteDomainBuildEventTrayChange, + sizeof(remote_domain_event_tray_change_msg), + (xdrproc_t)xdr_remote_domain_event_tray_change_msg }, }; enum virDrvOpenRemoteFlags { @@ -3731,6 +3740,31 @@ remoteDomainBuildEventDiskChange(virNetClientProgramPtr prog ATTRIBUTE_UNUSED, } +static void +remoteDomainBuildEventTrayChange(virNetClientProgramPtr prog ATTRIBUTE_UNUSED, + virNetClientPtr client ATTRIBUTE_UNUSED, + void *evdata, void *opaque) +{ + virConnectPtr conn = opaque; + struct private_data *priv = conn->privateData; + remote_domain_event_tray_change_msg *msg = evdata; + virDomainPtr dom; + virDomainEventPtr event = NULL; + + dom = get_nonnull_domain(conn, msg->dom); + if (!dom) + return; + + event = virDomainEventTrayChangeNewFromDom(dom, + msg->devAlias, + msg->reason); + + virDomainFree(dom); + + remoteDomainEventQueue(priv, event); +} + + static virDrvOpenStatus ATTRIBUTE_NONNULL (1) remoteSecretOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int flags) |