Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx> --- data/org.libvirt.Domain.xml | 9 +++++++++ src/domain.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index 10ce15a..3d8e7b1 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -60,6 +60,15 @@ <arg name="xml" type="s" direction="in"/> <arg name="flags" type="u" direction="in"/> </method> + <method name="BlockCommit"> + <annotation name="org.gtk.GDBus.DocString" + value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockCommit"/> + <arg name="disk" type="s" direction="in"/> + <arg name="base" type="s" direction="in"/> + <arg name="top" type="s" direction="in"/> + <arg name="bandwidth" type="t" 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#virDomainCreateWithFlags"/> diff --git a/src/domain.c b/src/domain.c index 1edad05..f482bb9 100644 --- a/src/domain.c +++ b/src/domain.c @@ -407,6 +407,33 @@ virtDBusDomainAttachDevice(GVariant *inArgs, virtDBusUtilSetLastVirtError(error); } +static void +virtDBusDomainBlockCommit(GVariant *inArgs, + 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; + const gchar *base; + const gchar *top; + gulong bandwidth; + guint flags; + + g_variant_get(inArgs, "(&s&s&stu)", &disk, &base, &top, &bandwidth, &flags); + + domain = virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + if (virDomainBlockCommit(domain, disk, base, top, bandwidth, flags) < 0) + virtDBusUtilSetLastVirtError(error); +} + static void virtDBusDomainBlockPeek(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -1303,6 +1330,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = { { "AbortJob", virtDBusDomainAbortJob }, { "AddIOThread", virtDBusDomainAddIOThread }, { "AttachDevice", virtDBusDomainAttachDevice }, + { "BlockCommit", virtDBusDomainBlockCommit }, { "BlockPeek", virtDBusDomainBlockPeek }, { "Create", virtDBusDomainCreate }, { "Destroy", virtDBusDomainDestroy }, -- 2.15.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list