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 cd8ff4d..3f91354 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -35,6 +35,11 @@ <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetUUIDString"/> </property> + <method name="Create"> + <annotation name="org.gtk.GDBus.DocString" + value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCreateWithFlags"/> + <arg name="flags" type="u" direction="in"/> + </method> <method name="GetVcpus"> <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetVcpusFlags"/> @@ -74,11 +79,6 @@ value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainReset"/> <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"/> - <arg name="flags" type="u" direction="in"/> - </method> <method name="Undefine"> <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainUndefineFlags"/> diff --git a/src/domain.c b/src/domain.c index cfbaf81..4e43a36 100644 --- a/src/domain.c +++ b/src/domain.c @@ -218,6 +218,29 @@ virtDBusDomainGetUUID(const gchar *objectPath, *value = g_variant_new("s", uuid); } +static void +virtDBusDomainCreate(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 (virDomainCreateWithFlags(domain, flags) < 0) + virtDBusUtilSetLastVirtError(error); +} + static void virtDBusDomainGetVcpus(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -404,29 +427,6 @@ virtDBusDomainReset(GVariant *inArgs, virtDBusUtilSetLastVirtError(error); } -static void -virtDBusDomainCreate(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 (virDomainCreateWithFlags(domain, flags) < 0) - virtDBusUtilSetLastVirtError(error); -} - static void virtDBusDomainUndefine(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -503,6 +503,7 @@ static virtDBusGDBusPropertyTable virtDBusDomainPropertyTable[] = { }; static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = { + { "Create", virtDBusDomainCreate }, { "GetVcpus", virtDBusDomainGetVcpus }, { "GetXMLDesc", virtDBusDomainGetXMLDesc }, { "GetStats", virtDBusDomainGetStats }, @@ -510,7 +511,6 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = { { "Destroy", virtDBusDomainDestroy }, { "Reboot", virtDBusDomainReboot }, { "Reset", virtDBusDomainReset }, - { "Create", virtDBusDomainCreate }, { "Undefine", virtDBusDomainUndefine }, { "Suspend", virtDBusDomainSuspend }, { "Resume", virtDBusDomainResume }, -- 2.15.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list