Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx> --- data/org.libvirt.Domain.xml | 7 +++++++ src/domain.c | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index 66cf5e2..367bc00 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -142,6 +142,13 @@ <arg name="flags" type="u" direction="in"/> <arg name="frozenFilesystems" type="u" direction="out"/> </method> + <method name="FSThaw"> + <annotation name="org.gtk.GDBus.DocString" + value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainFSThaw"/> + <arg name="mountpoints" type="as" direction="in"/> + <arg name="flags" type="u" direction="in"/> + <arg name="thawdFilesystems" type="u" direction="out"/> + </method> <method name="GetBlkioParameters"> <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetBlkioParameters"/> diff --git a/src/domain.c b/src/domain.c index 04115d1..a0feea9 100644 --- a/src/domain.c +++ b/src/domain.c @@ -732,6 +732,45 @@ virtDBusDomainFSFreeze(GVariant *inArgs, *outArgs = g_variant_new("(u)", ret); } +static void +virtDBusDomainFSThaw(GVariant *inArgs, + GUnixFDList *inFDs G_GNUC_UNUSED, + const gchar *objectPath, + gpointer userData, + GVariant **outArgs, + GUnixFDList **outFDs G_GNUC_UNUSED, + GError **error) +{ + virtDBusConnect *connect = userData; + g_autoptr(virDomain) domain = NULL; + g_autofree const gchar **mountpoints = NULL; + GVariantIter *iter; + guint nmountpoints; + guint flags; + gint ret; + + g_variant_get(inArgs, "(asu)", &iter, &flags); + + nmountpoints = g_variant_iter_n_children(iter); + if (nmountpoints) { + mountpoints = g_new0(const gchar*, nmountpoints + 1); + while (g_variant_iter_loop(iter, "s", &mountpoints[nmountpoints-1])) + nmountpoints++; + nmountpoints--; + g_variant_iter_free(iter); + } + + domain = virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + ret = virDomainFSThaw(domain, (const gchar **)mountpoints, nmountpoints, flags); + if (ret < 0) + virtDBusUtilSetLastVirtError(error); + + *outArgs = g_variant_new("(u)", ret); +} + static void virtDBusDomainGetBlkioParameters(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -1532,6 +1571,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = { { "Destroy", virtDBusDomainDestroy }, { "DetachDevice", virtDBusDomainDetachDevice }, { "FSFreeze", virtDBusDomainFSFreeze }, + { "FSThaw", virtDBusDomainFSThaw }, { "GetBlkioParameters", virtDBusDomainGetBlkioParameters }, { "GetControlInfo", virtDBusDomainGetControlInfo }, { "GetJobInfo", virtDBusDomainGetJobInfo }, -- 2.15.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list