Signed-off-by: Katerina Koukiou <kkoukiou(a)redhat.com>
---
data/org.libvirt.Connect.xml | 7 +++++++
src/connect.c | 27 +++++++++++++++++++++++++++
2 files changed, 34 insertions(+)
diff --git a/data/org.libvirt.Connect.xml b/data/org.libvirt.Connect.xml
index 55260cc..04ac2de 100644
--- a/data/org.libvirt.Connect.xml
+++ b/data/org.libvirt.Connect.xml
@@ -56,6 +56,13 @@
<arg name="uuid" type="s" direction="in"/>
<arg name="domain" type="o" direction="out"/>
</method>
+ <method name="DomainRestore">
+ <annotation name="org.gtk.GDBus.DocString"
+ value="See
https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainRestoreFlag...
+ <arg name="from" type="s" direction="in"/>
+ <arg name="xml" type="s" direction="in"/>
+ <arg name="flags" type="u" direction="in"/>
+ </method>
<method name="GetCapabilities">
<annotation name="org.gtk.GDBus.DocString"
value="See
https://libvirt.org/html/libvirt-libvirt-host.html#virConnectGetCapabilit...
diff --git a/src/connect.c b/src/connect.c
index a8ff43c..97e4d9c 100644
--- a/src/connect.c
+++ b/src/connect.c
@@ -347,6 +347,32 @@ virtDBusConnectDomainLookupByUUID(GVariant *inArgs,
*outArgs = g_variant_new("(o)", path);
}
+static void
+virtDBusConnectDomainRestoreFlags(GVariant *inArgs,
+ GUnixFDList *inFDs G_GNUC_UNUSED,
+ const gchar *objectPath G_GNUC_UNUSED,
+ gpointer userData,
+ GVariant **outArgs G_GNUC_UNUSED,
+ GUnixFDList **outFDs G_GNUC_UNUSED,
+ GError **error)
+{
+ virtDBusConnect *connect = userData;
+ g_autoptr(virDomain) domain = NULL;
+ const gchar *from;
+ const gchar *xml;
+ guint flags;
+
+ g_variant_get(inArgs, "(&s&su)", &from, &xml, &flags);
+ if (g_strcmp0(xml, "") == 0)
+ xml = NULL;
+
+ if (!virtDBusConnectOpen(connect, error))
+ return;
+
+ if (virDomainRestoreFlags(connect->connection, from, xml, flags) < 0)
+ virtDBusUtilSetLastVirtError(error);
+}
+
static void
virtDBusConnectGetSysinfo(GVariant *inArgs,
GUnixFDList *inFDs G_GNUC_UNUSED,
@@ -580,6 +606,7 @@ static virtDBusGDBusMethodTable virtDBusConnectMethodTable[] = {
{ "DomainLookupByID", virtDBusConnectDomainLookupByID },
{ "DomainLookupByName", virtDBusConnectDomainLookupByName },
{ "DomainLookupByUUID", virtDBusConnectDomainLookupByUUID },
+ { "DomainRestore", virtDBusConnectDomainRestoreFlags },
{ "GetCapabilities", virtDBusConnectGetCapabilities },
{ "GetSysinfo", virtDBusConnectGetSysinfo },
{ "ListDomains", virtDBusConnectListDomains },
--
2.15.0