Commit 23cc188f authored by Katerina Koukiou's avatar Katerina Koukiou

events: Register VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED

Signed-off-by: default avatarKaterina Koukiou <kkoukiou@redhat.com>
Reviewed-by: Pavel Hrdina's avatarPavel Hrdina <phrdina@redhat.com>
parent 66692fca
......@@ -622,6 +622,11 @@
value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventDeviceAddedCallback"/>
<arg name="device" type="s"/>
</signal>
<signal name="DeviceRemovalFailed">
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventDeviceRemovalFailedCallback"/>
<arg name="device" type="s"/>
</signal>
<signal name="DeviceRemoved">
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventDeviceRemovedCallback"/>
......
......@@ -116,6 +116,28 @@ virtDBusEventsDomainDeviceAdded(virConnectPtr connection G_GNUC_UNUSED,
return 0;
}
static gint
virtDBusEventsDomainDeviceRemovalFailed(virConnectPtr connection G_GNUC_UNUSED,
virDomainPtr domain,
const gchar *device,
gpointer opaque)
{
virtDBusConnect *connect = opaque;
g_autofree gchar *path = NULL;
path = virtDBusUtilBusPathForVirDomain(domain, connect->domainPath);
g_dbus_connection_emit_signal(connect->bus,
NULL,
path,
VIRT_DBUS_DOMAIN_INTERFACE,
"DeviceRemovalFailed",
g_variant_new("(s)", device),
NULL);
return 0;
}
static gint
virtDBusEventsDomainDeviceRemoved(virConnectPtr connection G_GNUC_UNUSED,
virDomainPtr domain,
......@@ -362,6 +384,10 @@ virtDBusEventsRegister(virtDBusConnect *connect)
VIR_DOMAIN_EVENT_ID_DEVICE_ADDED,
VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainDeviceAdded));
virtDBusEventsRegisterDomainEvent(connect,
VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED,
VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainDeviceRemovalFailed));
virtDBusEventsRegisterDomainEvent(connect,
VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED,
VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainDeviceRemoved));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment