Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx> --- data/org.libvirt.Domain.xml | 4 ++++ src/domain.c | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index c672053..074dd62 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -40,6 +40,10 @@ <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetUUIDString"/> </property> + <method name="AbortJob"> + <annotation name="org.gtk.GDBus.DocString" + value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainAbortJob"/> + </method> <method name="AttachDevice"> <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainAttachDeviceFlags"/> diff --git a/src/domain.c b/src/domain.c index 47bd585..b55a615 100644 --- a/src/domain.c +++ b/src/domain.c @@ -306,6 +306,26 @@ virtDBusDomainSetAutostart(GVariant *value, return virtDBusUtilSetLastVirtError(error); } +static void +virtDBusDomainAbortJob(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; + + domain = virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + if (virDomainAbortJob(domain) < 0) + virtDBusUtilSetLastVirtError(error); +} + static void virtDBusDomainAttachDevice(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -713,6 +733,7 @@ static virtDBusGDBusPropertyTable virtDBusDomainPropertyTable[] = { }; static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = { + { "AbortJob", virtDBusDomainAbortJob }, { "AttachDevice", virtDBusDomainAttachDevice }, { "Create", virtDBusDomainCreate }, { "Destroy", virtDBusDomainDestroy }, -- 2.15.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list