Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx> --- data/org.libvirt.Domain.xml | 10 +++++----- src/domain.c | 48 ++++++++++++++++++++++----------------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index 1be94ec..78378bb 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -64,11 +64,6 @@ <arg name="flags" type="u" direction="in"/> <arg name="xml" type="s" direction="out"/> </method> - <method name="Shutdown"> - <annotation name="org.gtk.GDBus.DocString" - value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainShutdownFlags"/> - <arg name="flags" type="u" direction="in"/> - </method> <method name="Reboot"> <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainReboot"/> @@ -83,6 +78,11 @@ <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainResume"/> </method> + <method name="Shutdown"> + <annotation name="org.gtk.GDBus.DocString" + value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainShutdownFlags"/> + <arg name="flags" type="u" direction="in"/> + </method> <method name="Suspend"> <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSuspend"/> diff --git a/src/domain.c b/src/domain.c index 4deef26..14f07fc 100644 --- a/src/domain.c +++ b/src/domain.c @@ -356,29 +356,6 @@ virtDBusDomainGetXMLDesc(GVariant *inArgs, *outArgs = g_variant_new("(s)", xml); } -static void -virtDBusDomainShutdown(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; - guint flags; - - g_variant_get(inArgs, "(u)", &flags); - - domain = virtDBusDomainGetVirDomain(connect, objectPath, error); - if (!domain) - return; - - if (virDomainShutdownFlags(domain, flags) < 0) - virtDBusUtilSetLastVirtError(error); -} - static void virtDBusDomainReboot(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -447,6 +424,29 @@ virtDBusDomainResume(GVariant *inArgs G_GNUC_UNUSED, virtDBusUtilSetLastVirtError(error); } +static void +virtDBusDomainShutdown(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; + guint flags; + + g_variant_get(inArgs, "(u)", &flags); + + domain = virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + if (virDomainShutdownFlags(domain, flags) < 0) + virtDBusUtilSetLastVirtError(error); +} + static void virtDBusDomainSuspend(GVariant *inArgs G_GNUC_UNUSED, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -508,10 +508,10 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = { { "GetStats", virtDBusDomainGetStats }, { "GetVcpus", virtDBusDomainGetVcpus }, { "GetXMLDesc", virtDBusDomainGetXMLDesc }, - { "Shutdown", virtDBusDomainShutdown }, { "Reboot", virtDBusDomainReboot }, { "Reset", virtDBusDomainReset }, { "Resume", virtDBusDomainResume }, + { "Shutdown", virtDBusDomainShutdown }, { "Suspend", virtDBusDomainSuspend }, { "Undefine", virtDBusDomainUndefine }, { 0 } -- 2.15.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list