Signed-off-by: Katerina Koukiou <kkoukiou(a)redhat.com>
---
data/org.libvirt.Domain.xml | 6 ++++++
src/domain.c | 25 +++++++++++++++++++++++++
2 files changed, 31 insertions(+)
diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml
index 3d8e7b1..480499c 100644
--- a/data/org.libvirt.Domain.xml
+++ b/data/org.libvirt.Domain.xml
@@ -69,6 +69,12 @@
<arg name="bandwidth" type="t"
direction="in"/>
<arg name="flags" type="u" direction="in"/>
</method>
+ <method name="BlockJobAbort">
+ <annotation name="org.gtk.GDBus.DocString"
+ value="See
https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockJobAbo...
+ <arg name="disk" type="s" direction="in"/>
+ <arg name="flags" type="u" direction="in"/>
+ </method>
<method name="BlockPeek">
<annotation name="org.gtk.GDBus.DocString"
value="See
https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCreateWithF...
diff --git a/src/domain.c b/src/domain.c
index f482bb9..fee4a2c 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -434,6 +434,30 @@ virtDBusDomainBlockCommit(GVariant *inArgs,
virtDBusUtilSetLastVirtError(error);
}
+static void
+virtDBusDomainBlockJobAbort(GVariant *inArgs G_GNUC_UNUSED,
+ GUnixFDList *inFDs G_GNUC_UNUSED,
+ const gchar *objectPath,
+ gpointer userData,
+ GVariant **outArgs G_GNUC_UNUSED,
+ GUnixFDList **outFDs G_GNUC_UNUSED,
+ GError **error)
+{
+ virtDBusConnect *connect = userData;
+ g_autoptr(virDomain) domain = NULL;
+ const gchar *disk;
+ guint flags;
+
+ g_variant_get(inArgs, "(&su)", &disk, &flags);
+
+ domain = virtDBusDomainGetVirDomain(connect, objectPath, error);
+ if (!domain)
+ return;
+
+ if (virDomainBlockJobAbort(domain, disk, flags) < 0)
+ virtDBusUtilSetLastVirtError(error);
+}
+
static void
virtDBusDomainBlockPeek(GVariant *inArgs,
GUnixFDList *inFDs G_GNUC_UNUSED,
@@ -1331,6 +1355,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = {
{ "AddIOThread", virtDBusDomainAddIOThread },
{ "AttachDevice", virtDBusDomainAttachDevice },
{ "BlockCommit", virtDBusDomainBlockCommit },
+ { "BlockJobAbort", virtDBusDomainBlockJobAbort },
{ "BlockPeek", virtDBusDomainBlockPeek },
{ "Create", virtDBusDomainCreate },
{ "Destroy", virtDBusDomainDestroy },
--
2.15.0