Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx> --- data/org.libvirt.Domain.xml | 7 +++++++ src/domain.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index bcd0779..221bccb 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -390,6 +390,13 @@ value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateStartPostCopy"/> <arg name="flags" type="u" direction="in"/> </method> + <method name="MigrateToURI3"> + <annotation name="org.gtk.GDBus.DocString" + value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateToURI3"/> + <arg name="dconuri" type="s" direction="in"/> + <arg name="params" type="a{sv}" direction="in"/> + <arg name="flags" type="u" direction="in"/> + </method> <method name="OpenGraphicsFD"> <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainOpenGraphicsFD"/> diff --git a/src/domain.c b/src/domain.c index eaef68c..1a57621 100644 --- a/src/domain.c +++ b/src/domain.c @@ -2033,6 +2033,39 @@ virtDBusDomainMigrateStartPostCopy(GVariant *inArgs, virtDBusUtilSetLastVirtError(error); } +static void +virtDBusDomainMigrateToURI3(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; + g_autoptr(GVariantIter) iter = NULL; + const gchar* dconuri; + g_auto(virtDBusUtilTypedParams) params = { 0 }; + guint flags; + + g_variant_get(inArgs, "(&sa{sv}u)", &dconuri, &iter, &flags); + + if (!virtDBusUtilGVariantToTypedParams(iter, ¶ms.params, + ¶ms.nparams, error)) { + return; + } + + domain = virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + if (virDomainMigrateToURI3(domain, dconuri, params.params, + params.nparams, flags) < 0) + virtDBusUtilSetLastVirtError(error); +} + static void virtDBusDomainOpenGraphicsFD(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -2926,6 +2959,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = { { "MigrateSetMaxDowntime", virtDBusDomainMigrateSetMaxDowntime }, { "MigrateSetMaxSpeed", virtDBusDomainMigrateSetMaxSpeed }, { "MigrateStartPostCopy", virtDBusDomainMigrateStartPostCopy }, + { "MigrateToURI3", virtDBusDomainMigrateToURI3 }, { "OpenGraphicsFD", virtDBusDomainOpenGraphicsFD }, { "PinEmulator", virtDBusDomainPinEmulator }, { "PinIOThread", virtDBusDomainPinIOThread }, -- 2.17.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list