Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx> --- data/org.libvirt.Domain.xml | 7 +++++++ src/domain.c | 26 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index f5c7fb0..c7fb637 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -99,6 +99,13 @@ <arg name="bandwidth" type="t" direction="in"/> <arg name="flags" type="u" direction="in"/> </method> + <method name="BlockResize"> + <annotation name="org.gtk.GDBus.DocString" + value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockResize"/> + <arg name="disk" type="s" direction="in"/> + <arg name="size" type="t" direction="in"/> + <arg name="flags" type="u" direction="in"/> + </method> <method name="Create"> <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 107355e..191d9e8 100644 --- a/src/domain.c +++ b/src/domain.c @@ -549,6 +549,31 @@ virtDBusDomainBlockRebase(GVariant *inArgs, virtDBusUtilSetLastVirtError(error); } +static void +virtDBusDomainBlockResize(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; + gulong size; + guint flags; + + g_variant_get(inArgs, "(&stu)", &disk, &size, &flags); + + domain = virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + if (virDomainBlockResize(domain, disk, size, flags) < 0) + virtDBusUtilSetLastVirtError(error); +} + static void virtDBusDomainCreate(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -1412,6 +1437,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = { { "BlockPeek", virtDBusDomainBlockPeek }, { "BlockPull", virtDBusDomainBlockPull }, { "BlockRebase", virtDBusDomainBlockRebase }, + { "BlockResize", virtDBusDomainBlockResize }, { "Create", virtDBusDomainCreate }, { "Destroy", virtDBusDomainDestroy }, { "DetachDevice", virtDBusDomainDetachDevice }, -- 2.15.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list