From nobody Wed May 14 19:54:57 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 152329356275148.535595463255845; Mon, 9 Apr 2018 10:06:02 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 50EED81DF4; Mon, 9 Apr 2018 17:06:01 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 257745FCB8; Mon, 9 Apr 2018 17:06:01 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D60FB180215F; Mon, 9 Apr 2018 17:06:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w39H5oEE018551 for ; Mon, 9 Apr 2018 13:05:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5AD8AD7E06; Mon, 9 Apr 2018 17:05:50 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id 018367C51 for ; Mon, 9 Apr 2018 17:05:49 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Mon, 9 Apr 2018 19:05:36 +0200 Message-Id: <20180409170543.7840-5-kkoukiou@redhat.com> In-Reply-To: <20180409170543.7840-1-kkoukiou@redhat.com> References: <20180409170543.7840-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH v2 04/11] APIs should appear in alphabetical order: Move UUID property X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 09 Apr 2018 17:06:01 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou --- 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 @@ - - - @@ -35,6 +31,10 @@ + + + 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 =3D g_variant_new("s", name); } =20 -static void -virtDBusDomainGetUUID(const gchar *objectPath, - gpointer userData, - GVariant **value, - GError **error) -{ - virtDBusConnect *connect =3D userData; - g_autoptr(virDomain) domain =3D NULL; - gchar uuid[VIR_UUID_STRING_BUFLEN] =3D ""; - - domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); - if (!domain) - return; - - if (virDomainGetUUIDString(domain, uuid) < 0) - return virtDBusUtilSetLastVirtError(error); - - *value =3D g_variant_new("s", uuid); -} - static void virtDBusDomainGetOsType(const gchar *objectPath, gpointer userData, @@ -218,6 +198,26 @@ virtDBusDomainGetState(const gchar *objectPath, *value =3D g_variant_new("s", string); } =20 +static void +virtDBusDomainGetUUID(const gchar *objectPath, + gpointer userData, + GVariant **value, + GError **error) +{ + virtDBusConnect *connect =3D userData; + g_autoptr(virDomain) domain =3D NULL; + gchar uuid[VIR_UUID_STRING_BUFLEN] =3D ""; + + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + if (virDomainGetUUIDString(domain, uuid) < 0) + return virtDBusUtilSetLastVirtError(error); + + *value =3D g_variant_new("s", uuid); +} + static void virtDBusDomainGetVcpus(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -495,10 +495,10 @@ static virtDBusGDBusPropertyTable virtDBusDomainPrope= rtyTable[] =3D { { "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 } }; =20 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) =20 # Call all methods except Reset and GetStats, because the test bac= kend # doesn't support those --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list