[libvirt] [dbus PATCH 21/25] Implement DomainRestore method for Connect Interface
Pavel Hrdina
phrdina at redhat.com
Wed Apr 18 08:18:20 UTC 2018
On Tue, Apr 17, 2018 at 02:04:40PM +0200, Katerina Koukiou wrote:
> Signed-off-by: Katerina Koukiou <kkoukiou at 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#virDomainRestoreFlags"/>
> + <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#virConnectGetCapabilities"/>
> 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)
You can use g_str_equal().
Reviewed-by: Pavel Hrdina <phrdina at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180418/f0dca9cd/attachment-0001.sig>
More information about the libvir-list
mailing list