Commit f38d2f35 authored by Katerina Koukiou's avatar Katerina Koukiou

events: Register VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2

Signed-off-by: default avatarKaterina Koukiou <kkoukiou@redhat.com>
Reviewed-by: Pavel Hrdina's avatarPavel Hrdina <phrdina@redhat.com>
parent 382b6670
......@@ -615,6 +615,14 @@
value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventBalloonChangeCallback"/>
<arg name="actual" type="t"/>
</signal>
<signal name="BlockJob">
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventBlockJobCallback
Callback was registered using VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2"/>
<arg name="disk" type="s"/>
<arg name="type" type="i"/>
<arg name="status" type="i"/>
</signal>
<signal name="ControlError">
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventGenericCallback"/>
......
......@@ -50,6 +50,30 @@ virtDBusEventsDomainBalloonChange(virConnectPtr connection G_GNUC_UNUSED,
return 0;
}
static gint
virtDBusEventsDomainBlockJob(virConnectPtr connection G_GNUC_UNUSED,
virDomainPtr domain,
gchar *disk,
gint type,
gint status,
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,
"BlockJob",
g_variant_new("(sii)", disk, type, status),
NULL);
return 0;
}
static gint
virtDBusEventsDomainControlError(virConnectPtr connection G_GNUC_UNUSED,
virDomainPtr domain,
......@@ -600,6 +624,10 @@ virtDBusEventsRegister(virtDBusConnect *connect)
VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE,
VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainBalloonChange));
virtDBusEventsRegisterDomainEvent(connect,
VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2,
VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainBlockJob));
virtDBusEventsRegisterDomainEvent(connect,
VIR_DOMAIN_EVENT_ID_CONTROL_ERROR,
VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainControlError));
......
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