Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx> --- data/org.libvirt.Domain.xml | 8 ++++---- src/domain.c | 42 +++++++++++++++++++++--------------------- test/test_domain.py | 2 +- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index edf7491..cd8ff4d 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -19,10 +19,6 @@ <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetName"/> </property> - <property name="UUID" type="s" access="read"> - <annotation name="org.gtk.GDBus.DocString" - value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetUUIDString"/> - </property> <property name="OSType" type="s" access="read"> <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetOSType"/> @@ -35,6 +31,10 @@ <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetState"/> </property> + <property name="UUID" type="s" access="read"> + <annotation name="org.gtk.GDBus.DocString" + value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetUUIDString"/> + </property> <method name="GetVcpus"> <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetVcpusFlags"/> diff --git a/src/domain.c b/src/domain.c index 87c205f..cfbaf81 100644 --- a/src/domain.c +++ b/src/domain.c @@ -107,26 +107,6 @@ virtDBusDomainGetName(const gchar *objectPath, *value = g_variant_new("s", name); } -static void -virtDBusDomainGetUUID(const gchar *objectPath, - gpointer userData, - GVariant **value, - GError **error) -{ - virtDBusConnect *connect = userData; - g_autoptr(virDomain) domain = NULL; - gchar uuid[VIR_UUID_STRING_BUFLEN] = ""; - - domain = virtDBusDomainGetVirDomain(connect, objectPath, error); - if (!domain) - return; - - if (virDomainGetUUIDString(domain, uuid) < 0) - return virtDBusUtilSetLastVirtError(error); - - *value = g_variant_new("s", uuid); -} - static void virtDBusDomainGetOsType(const gchar *objectPath, gpointer userData, @@ -218,6 +198,26 @@ virtDBusDomainGetState(const gchar *objectPath, *value = g_variant_new("s", string); } +static void +virtDBusDomainGetUUID(const gchar *objectPath, + gpointer userData, + GVariant **value, + GError **error) +{ + virtDBusConnect *connect = userData; + g_autoptr(virDomain) domain = NULL; + gchar uuid[VIR_UUID_STRING_BUFLEN] = ""; + + domain = virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + if (virDomainGetUUIDString(domain, uuid) < 0) + return virtDBusUtilSetLastVirtError(error); + + *value = g_variant_new("s", uuid); +} + static void virtDBusDomainGetVcpus(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -495,10 +495,10 @@ static virtDBusGDBusPropertyTable virtDBusDomainPropertyTable[] = { { "Autostart", virtDBusDomainGetAutostart, NULL }, { "Id", virtDBusDomainGetId, NULL }, { "Name", virtDBusDomainGetName, NULL }, - { "UUID", virtDBusDomainGetUUID, NULL }, { "OSType", virtDBusDomainGetOsType, NULL }, { "Persistent", virtDBusDomainGetPersistent, NULL }, { "State", virtDBusDomainGetState, NULL }, + { "UUID", virtDBusDomainGetUUID, NULL }, { 0 } }; diff --git a/test/test_domain.py b/test/test_domain.py index c3ffebf..edcf106 100755 --- a/test/test_domain.py +++ b/test/test_domain.py @@ -14,10 +14,10 @@ class TestDomain(libvirttest.BaseTestClass): assert isinstance(props['Autostart'], dbus.Boolean) assert isinstance(props['Id'], dbus.UInt32) assert isinstance(props['Name'], dbus.String) - assert isinstance(props['UUID'], dbus.String) assert isinstance(props['OSType'], dbus.String) assert isinstance(props['Persistent'], dbus.Boolean) assert isinstance(props['State'], dbus.String) + assert isinstance(props['UUID'], dbus.String) # Call all methods except Reset and GetStats, because the test backend # doesn't support those -- 2.15.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list