From nobody Fri May 3 05:27:08 2024 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 1525687854049227.30296486145892; Mon, 7 May 2018 03:10:54 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3E03980F99; Mon, 7 May 2018 10:10:52 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EFF201755F; Mon, 7 May 2018 10:10:51 +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 9E9864CAA9; Mon, 7 May 2018 10:10:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w47A6eB5022933 for ; Mon, 7 May 2018 06:06:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id 75A76111F3DB; Mon, 7 May 2018 10:06:40 +0000 (UTC) Received: from antique-work.brq.redhat.com (unknown [10.43.2.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id 19CD9111F3DA for ; Mon, 7 May 2018 10:06:39 +0000 (UTC) From: Pavel Hrdina To: libvir-list@redhat.com Date: Mon, 7 May 2018 12:06:28 +0200 Message-Id: <22ce2a1bd255cfa8da96430f45120eab07051817.1525687535.git.phrdina@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH 1/9] Process input arguments before getting libvirt object 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 07 May 2018 10:10:52 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina --- src/connect.c | 6 +++--- src/domain.c | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/connect.c b/src/connect.c index 0025023..3d2be96 100644 --- a/src/connect.c +++ b/src/connect.c @@ -1046,14 +1046,14 @@ virtDBusConnectNodeSetMemoryParameters(GVariant *in= Args, =20 g_variant_get(inArgs, "(a{sv}u)", &iter, &flags); =20 - if (!virtDBusConnectOpen(connect, error)) - return; - if (!virtDBusUtilGVariantToTypedParams(iter, ¶ms.params, ¶ms.nparams, error)) { return; } =20 + if (!virtDBusConnectOpen(connect, error)) + return; + if (virNodeSetMemoryParameters(connect->connection, params.params, params.nparams, flags) < 0) { virtDBusUtilSetLastVirtError(error); diff --git a/src/domain.c b/src/domain.c index 262ebe2..17231bd 100644 --- a/src/domain.c +++ b/src/domain.c @@ -1995,10 +1995,6 @@ virtDBusDomainPinEmulator(GVariant *inArgs, =20 g_variant_get(inArgs, "(abu)", &iter, &flags); =20 - domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); - if (!domain) - return; - cpus =3D g_variant_iter_n_children(iter); cpumaplen =3D VIR_CPU_MAPLEN(cpus); cpumap =3D g_new0(guchar, cpumaplen); @@ -2008,6 +2004,10 @@ virtDBusDomainPinEmulator(GVariant *inArgs, cnt++; } =20 + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + if (virDomainPinEmulator(domain, cpumap, cpumaplen, flags) < 0) virtDBusUtilSetLastVirtError(error); } @@ -2035,10 +2035,6 @@ virtDBusDomainPinIOThread(GVariant *inArgs, =20 g_variant_get(inArgs, "(uabu)", &iothreadId, &iter, &flags); =20 - domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); - if (!domain) - return; - cpus =3D g_variant_iter_n_children(iter); cpumaplen =3D VIR_CPU_MAPLEN(cpus); cpumap =3D g_new0(guchar, cpumaplen); @@ -2048,6 +2044,10 @@ virtDBusDomainPinIOThread(GVariant *inArgs, cnt++; } =20 + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + if (virDomainPinIOThread(domain, iothreadId, cpumap, cpumaplen, flags)= < 0) virtDBusUtilSetLastVirtError(error); } @@ -2075,10 +2075,6 @@ virtDBusDomainPinVcpu(GVariant *inArgs, =20 g_variant_get(inArgs, "(uabu)", &vcpu, &iter, &flags); =20 - domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); - if (!domain) - return; - cpus =3D g_variant_iter_n_children(iter); cpumaplen =3D VIR_CPU_MAPLEN(cpus); cpumap =3D g_new0(guchar, cpumaplen); @@ -2088,6 +2084,10 @@ virtDBusDomainPinVcpu(GVariant *inArgs, cnt++; } =20 + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + if (virDomainPinVcpuFlags(domain, vcpu, cpumap, cpumaplen, flags) < 0) virtDBusUtilSetLastVirtError(error); } --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 05:27:08 2024 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 1525687654580408.03540446855607; Mon, 7 May 2018 03:07:34 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6ACC9C0587C2; Mon, 7 May 2018 10:07:32 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4483D17A9D; Mon, 7 May 2018 10:07:31 +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 4109B4CAA9; Mon, 7 May 2018 10:07:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w47A6fbv022941 for ; Mon, 7 May 2018 06:06:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 17A9F111F3DB; Mon, 7 May 2018 10:06:41 +0000 (UTC) Received: from antique-work.brq.redhat.com (unknown [10.43.2.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id B051D111F3DA for ; Mon, 7 May 2018 10:06:40 +0000 (UTC) From: Pavel Hrdina To: libvir-list@redhat.com Date: Mon, 7 May 2018 12:06:29 +0200 Message-Id: <7020e03d039e2a7307187592e22bffdae09422c5.1525687535.git.phrdina@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH 2/9] Use ++ operator instead of += in for loop 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 07 May 2018 10:07:33 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina --- src/connect.c | 10 +++++----- src/main.c | 2 +- src/network.c | 2 +- src/util.c | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/connect.c b/src/connect.c index 3d2be96..e96294d 100644 --- a/src/connect.c +++ b/src/connect.c @@ -39,7 +39,7 @@ virtDBusConnectClose(virtDBusConnect *connect, gboolean deregisterEvents) { =20 - for (gint i =3D 0; i < VIR_DOMAIN_EVENT_ID_LAST; i +=3D 1) { + for (gint i =3D 0; i < VIR_DOMAIN_EVENT_ID_LAST; i++) { if (connect->domainCallbackIds[i] >=3D 0) { if (deregisterEvents) { virConnectDomainEventDeregisterAny(connect->connection, @@ -49,7 +49,7 @@ virtDBusConnectClose(virtDBusConnect *connect, } } =20 - for (gint i =3D 0; i < VIR_NETWORK_EVENT_ID_LAST; i +=3D 1) { + for (gint i =3D 0; i < VIR_NETWORK_EVENT_ID_LAST; i++) { if (connect->networkCallbackIds[i] >=3D 0) { if (deregisterEvents) { virConnectNetworkEventDeregisterAny(connect->connection, @@ -1135,10 +1135,10 @@ virtDBusConnectNew(virtDBusConnect **connectp, =20 g_mutex_init(&connect->lock); =20 - for (gint i =3D 0; i < VIR_DOMAIN_EVENT_ID_LAST; i +=3D 1) + for (gint i =3D 0; i < VIR_DOMAIN_EVENT_ID_LAST; i++) connect->domainCallbackIds[i] =3D -1; =20 - for (gint i =3D 0; i < VIR_NETWORK_EVENT_ID_LAST; i +=3D 1) + for (gint i =3D 0; i < VIR_NETWORK_EVENT_ID_LAST; i++) connect->networkCallbackIds[i] =3D -1; =20 connect->bus =3D bus; @@ -1170,7 +1170,7 @@ virtDBusConnectListFree(virtDBusConnect **connectList) if (!connectList) return; =20 - for (gint i =3D 0; connectList[i]; i +=3D 1) + for (gint i =3D 0; connectList[i]; i++) virtDBusConnectFree(connectList[i]); =20 g_free(connectList); diff --git a/src/main.c b/src/main.c index eb30ef8..c953726 100644 --- a/src/main.c +++ b/src/main.c @@ -54,7 +54,7 @@ virtDBusAcquired(GDBusConnection *connection, virtDBusRegisterData *data =3D opaque; g_autoptr(GError) error =3D NULL; =20 - for (gsize i =3D 0; i < data->ndrivers; i +=3D 1) { + for (gsize i =3D 0; i < data->ndrivers; i++) { virtDBusConnectNew(&data->connectList[i], connection, data->drivers[i].uri, data->drivers[i].object, &error); diff --git a/src/network.c b/src/network.c index 2fb5ec6..1763eca 100644 --- a/src/network.c +++ b/src/network.c @@ -6,7 +6,7 @@ static void virtDBusNetworkDHCPLeaseListFree(virNetworkDHCPLeasePtr *leases) { - for (gint i =3D 0; leases[i] !=3D NULL; i +=3D 1) + for (gint i =3D 0; leases[i] !=3D NULL; i++) virNetworkDHCPLeaseFree(leases[i]); =20 g_free(leases); diff --git a/src/util.c b/src/util.c index 4efa3ec..8b28496 100644 --- a/src/util.c +++ b/src/util.c @@ -208,7 +208,7 @@ virtDBusUtilVirDomainFromBusPath(virConnectPtr connecti= on, void virtDBusUtilVirDomainListFree(virDomainPtr *domains) { - for (gint i =3D 0; domains[i] !=3D NULL; i +=3D 1) + for (gint i =3D 0; domains[i] !=3D NULL; i++) virDomainFree(domains[i]); =20 g_free(domains); @@ -241,7 +241,7 @@ virtDBusUtilBusPathForVirNetwork(virNetworkPtr network, void virtDBusUtilVirNetworkListFree(virNetworkPtr *networks) { - for (gint i =3D 0; networks[i] !=3D NULL; i +=3D 1) + for (gint i =3D 0; networks[i] !=3D NULL; i++) virNetworkFree(networks[i]); =20 g_free(networks); --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 05:27:08 2024 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 1525687671291583.0870718081352; Mon, 7 May 2018 03:07:51 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C0CB081DE1; Mon, 7 May 2018 10:07:49 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 890E79C982; Mon, 7 May 2018 10:07:49 +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 4118A4CAAF; Mon, 7 May 2018 10:07:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w47A6fvR022949 for ; Mon, 7 May 2018 06:06:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id AF792111F3DB; Mon, 7 May 2018 10:06:41 +0000 (UTC) Received: from antique-work.brq.redhat.com (unknown [10.43.2.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id 53B9D111F3DA for ; Mon, 7 May 2018 10:06:41 +0000 (UTC) From: Pavel Hrdina To: libvir-list@redhat.com Date: Mon, 7 May 2018 12:06:30 +0200 Message-Id: <6aec01ad43085386c90ae5a11dc57953f8b51940.1525687535.git.phrdina@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH 3/9] connect: Fix List* methods to return empty array for empty list 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.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 07 May 2018 10:07:50 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina --- src/connect.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/connect.c b/src/connect.c index e96294d..cd90939 100644 --- a/src/connect.c +++ b/src/connect.c @@ -657,9 +657,6 @@ virtDBusConnectListDomains(GVariant *inArgs, if (virConnectListAllDomains(connect->connection, &domains, flags) < 0) return virtDBusUtilSetLastVirtError(error); =20 - if (!*domains) - return; - g_variant_builder_init(&builder, G_VARIANT_TYPE("ao")); =20 for (gint i =3D 0; domains[i]; i++) { @@ -697,9 +694,6 @@ virtDBusConnectListNetworks(GVariant *inArgs, if (virConnectListAllNetworks(connect->connection, &networks, flags) <= 0) return virtDBusUtilSetLastVirtError(error); =20 - if (!*networks) - return; - g_variant_builder_init(&builder, G_VARIANT_TYPE("ao")); =20 for (gint i =3D 0; networks[i]; i++) { --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 05:27:08 2024 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 1525688145762964.3876384669077; Mon, 7 May 2018 03:15:45 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9D9713003A55; Mon, 7 May 2018 10:15:42 +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 0895C608F7; Mon, 7 May 2018 10:15:42 +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 00B4C1808800; Mon, 7 May 2018 10:15:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w47A6gMe022954 for ; Mon, 7 May 2018 06:06:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 515BF111F3DB; Mon, 7 May 2018 10:06:42 +0000 (UTC) Received: from antique-work.brq.redhat.com (unknown [10.43.2.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id EA2F6111F3DA for ; Mon, 7 May 2018 10:06:41 +0000 (UTC) From: Pavel Hrdina To: libvir-list@redhat.com Date: Mon, 7 May 2018 12:06:31 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH 4/9] connect: Pass error into virtDBusConnectOpen function 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Mon, 07 May 2018 10:15:44 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We need to pass the error pointer in order to report proper error. Signed-off-by: Pavel Hrdina --- src/connect.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/connect.c b/src/connect.c index cd90939..fd335e3 100644 --- a/src/connect.c +++ b/src/connect.c @@ -342,7 +342,7 @@ virtDBusConnectDomainLookupByID(GVariant *inArgs, =20 g_variant_get(inArgs, "(u)", &id); =20 - if (!virtDBusConnectOpen(connect, NULL)) + if (!virtDBusConnectOpen(connect, error)) return; =20 domain =3D virDomainLookupByID(connect->connection, id); @@ -370,7 +370,7 @@ virtDBusConnectDomainLookupByName(GVariant *inArgs, =20 g_variant_get(inArgs, "(s)", &name); =20 - if (!virtDBusConnectOpen(connect, NULL)) + if (!virtDBusConnectOpen(connect, error)) return; =20 domain =3D virDomainLookupByName(connect->connection, name); @@ -398,7 +398,7 @@ virtDBusConnectDomainLookupByUUID(GVariant *inArgs, =20 g_variant_get(inArgs, "(s)", &uuidstr); =20 - if (!virtDBusConnectOpen(connect, NULL)) + if (!virtDBusConnectOpen(connect, error)) return; =20 domain =3D virDomainLookupByUUIDString(connect->connection, uuidstr); --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 05:27:08 2024 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 1525688151552516.6824823953139; Mon, 7 May 2018 03:15:51 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 147593002481; Mon, 7 May 2018 10:15:50 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D509E313CAEF; Mon, 7 May 2018 10:15:49 +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 7B3464CA96; Mon, 7 May 2018 10:15:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w47A6hHA022967 for ; Mon, 7 May 2018 06:06:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id E79AB111F3DB; Mon, 7 May 2018 10:06:42 +0000 (UTC) Received: from antique-work.brq.redhat.com (unknown [10.43.2.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C62F111F3DA for ; Mon, 7 May 2018 10:06:42 +0000 (UTC) From: Pavel Hrdina To: libvir-list@redhat.com Date: Mon, 7 May 2018 12:06:32 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH 5/9] domain: There is no need to check ret again 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.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Mon, 07 May 2018 10:15:50 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina --- src/domain.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/domain.c b/src/domain.c index 17231bd..20d41fe 100644 --- a/src/domain.c +++ b/src/domain.c @@ -938,7 +938,8 @@ virtDBusDomainGetBlockIOTune(GVariant *inArgs, ret =3D virDomainGetBlockIoTune(domain, disk, NULL, ¶ms.nparams, f= lags); if (ret < 0) return virtDBusUtilSetLastVirtError(error); - if (ret =3D=3D 0 && params.nparams !=3D 0) { + + if (params.nparams !=3D 0) { params.params =3D g_new0(virTypedParameter, params.nparams); if (virDomainGetBlockIoTune(domain, disk, params.params, ¶ms.nparams, flags) < 0) { --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 05:27:08 2024 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 1525687859465397.86833150346627; Mon, 7 May 2018 03:10:59 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D5C44C047B66; Mon, 7 May 2018 10:10:57 +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 935B365960; Mon, 7 May 2018 10:10:57 +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 1F68F180BADC; Mon, 7 May 2018 10:10:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w47A6hHM022974 for ; Mon, 7 May 2018 06:06:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id 89D06111F3DC; Mon, 7 May 2018 10:06:43 +0000 (UTC) Received: from antique-work.brq.redhat.com (unknown [10.43.2.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2E6EA111F3DA for ; Mon, 7 May 2018 10:06:43 +0000 (UTC) From: Pavel Hrdina To: libvir-list@redhat.com Date: Mon, 7 May 2018 12:06:33 +0200 Message-Id: <7301ecface0267ef13b255784d3444790a7e0f57.1525687535.git.phrdina@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH 6/9] domain: Return error if libvirt API fails 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 07 May 2018 10:10:58 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina --- src/domain.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/domain.c b/src/domain.c index 20d41fe..b361aa6 100644 --- a/src/domain.c +++ b/src/domain.c @@ -1339,7 +1339,10 @@ virtDBusDomainGetMemoryParameters(GVariant *inArgs, return; =20 ret =3D virDomainGetMemoryParameters(domain, NULL, ¶ms.nparams, fl= ags); - if (ret =3D=3D 0 && params.nparams !=3D 0) { + if (ret < 0) + return virtDBusUtilSetLastVirtError(error); + + if (params.nparams !=3D 0) { params.params =3D g_new0(virTypedParameter, params.nparams); if (virDomainGetMemoryParameters(domain, params.params, ¶ms.nparams, flags) < 0) { @@ -1475,7 +1478,10 @@ virtDBusDomainGetSchedulerParameters(GVariant *inArg= s, return; =20 ret =3D virDomainGetSchedulerType(domain, ¶ms.nparams); - if (ret && params.nparams !=3D 0) { + if (!ret) + return virtDBusUtilSetLastVirtError(error); + + if (params.nparams !=3D 0) { params.params =3D g_new0(virTypedParameter, params.nparams); if (virDomainGetSchedulerParametersFlags(domain, params.params, ¶ms.nparams, 0)) --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 05:27:08 2024 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 1525687865865349.9510396888993; Mon, 7 May 2018 03:11:05 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 57D9BC057F4E; Mon, 7 May 2018 10:11:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 132521755F; Mon, 7 May 2018 10:11:04 +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 B71B24CAAD; Mon, 7 May 2018 10:11:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w47A6i29022979 for ; Mon, 7 May 2018 06:06:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2C3D4111F3DB; Mon, 7 May 2018 10:06:44 +0000 (UTC) Received: from antique-work.brq.redhat.com (unknown [10.43.2.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4CCE111F3DA for ; Mon, 7 May 2018 10:06:43 +0000 (UTC) From: Pavel Hrdina To: libvir-list@redhat.com Date: Mon, 7 May 2018 12:06:34 +0200 Message-Id: <48899f7daa0013c58451ab12a24d989900fed4a6.1525687535.git.phrdina@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH 7/9] domain: Introduce virtDBusDomainGVariantToMountpoints helper 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 07 May 2018 10:11:05 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina --- src/domain.c | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/domain.c b/src/domain.c index b361aa6..c6dc744 100644 --- a/src/domain.c +++ b/src/domain.c @@ -109,6 +109,22 @@ virtDBusDomainMemoryStatsToGVariant(virDomainMemorySta= tPtr stats, return g_variant_builder_end(&builder); } =20 +static void +virtDBusDomainGVariantToMountpoints(GVariantIter *iter, + const gchar ***mountpoints, + guint *nmountpoints) +{ + const gchar **tmp; + + *nmountpoints =3D g_variant_iter_n_children(iter); + if (*nmountpoints > 0) { + *mountpoints =3D g_new0(const gchar*, *nmountpoints); + tmp =3D *mountpoints; + while (g_variant_iter_next(iter, "&s", tmp)) + tmp++; + } +} + static virDomainPtr virtDBusDomainGetVirDomain(virtDBusConnect *connect, const gchar *objectPath, @@ -783,21 +799,14 @@ virtDBusDomainFSFreeze(GVariant *inArgs, virtDBusConnect *connect =3D userData; g_autoptr(virDomain) domain =3D NULL; g_autofree const gchar **mountpoints =3D NULL; - const gchar **tmp; g_autoptr(GVariantIter) iter; - gsize nmountpoints =3D 0; + guint nmountpoints; guint flags; gint ret; =20 g_variant_get(inArgs, "(asu)", &iter, &flags); =20 - nmountpoints =3D g_variant_iter_n_children(iter); - if (nmountpoints > 0) { - mountpoints =3D g_new0(const gchar*, nmountpoints); - tmp =3D mountpoints; - while (g_variant_iter_next(iter, "&s", tmp)) - tmp++; - } + virtDBusDomainGVariantToMountpoints(iter, &mountpoints, &nmountpoints); =20 domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); if (!domain) @@ -822,7 +831,6 @@ virtDBusDomainFSThaw(GVariant *inArgs, virtDBusConnect *connect =3D userData; g_autoptr(virDomain) domain =3D NULL; g_autofree const gchar **mountpoints =3D NULL; - const gchar **tmp; g_autoptr(GVariantIter) iter; guint nmountpoints; guint flags; @@ -830,13 +838,7 @@ virtDBusDomainFSThaw(GVariant *inArgs, =20 g_variant_get(inArgs, "(asu)", &iter, &flags); =20 - nmountpoints =3D g_variant_iter_n_children(iter); - if (nmountpoints > 0) { - mountpoints =3D g_new0(const gchar*, nmountpoints); - tmp =3D mountpoints; - while (g_variant_iter_next(iter, "&s", tmp)) - tmp++; - } + virtDBusDomainGVariantToMountpoints(iter, &mountpoints, &nmountpoints); =20 domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); if (!domain) --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 05:27:08 2024 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 1525687677794165.18566450629987; Mon, 7 May 2018 03:07:57 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0CB2E30023C6; Mon, 7 May 2018 10:07:56 +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 D31622010CA5; Mon, 7 May 2018 10:07:55 +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 7D48B180BADC; Mon, 7 May 2018 10:07:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w47A6i1K022992 for ; Mon, 7 May 2018 06:06:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id C2ED9111F3DB; Mon, 7 May 2018 10:06:44 +0000 (UTC) Received: from antique-work.brq.redhat.com (unknown [10.43.2.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id 67324111F3DA for ; Mon, 7 May 2018 10:06:44 +0000 (UTC) From: Pavel Hrdina To: libvir-list@redhat.com Date: Mon, 7 May 2018 12:06:35 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH 8/9] domain: Introduce virtDBusDomainGVariantToCpumap helper 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.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 07 May 2018 10:07:56 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina --- src/domain.c | 55 ++++++++++++++++++++++--------------------------------- 1 file changed, 22 insertions(+), 33 deletions(-) diff --git a/src/domain.c b/src/domain.c index c6dc744..2ba58e0 100644 --- a/src/domain.c +++ b/src/domain.c @@ -125,6 +125,25 @@ virtDBusDomainGVariantToMountpoints(GVariantIter *iter, } } =20 +static void +virtDBusDomainGVariantToCpumap(GVariantIter *iter, + guchar **cpumap, + guint *cpumaplen) +{ + gboolean usable; + guint cpus =3D g_variant_iter_n_children(iter); + guint cnt =3D 0; + + *cpumaplen =3D VIR_CPU_MAPLEN(cpus); + *cpumap =3D g_new0(guchar, cpumaplen); + + while (g_variant_iter_loop(iter, "b", &usable)) { + if (usable) + VIR_USE_CPU(*cpumap, cnt); + cnt++; + } +} + static virDomainPtr virtDBusDomainGetVirDomain(virtDBusConnect *connect, const gchar *objectPath, @@ -1996,22 +2015,12 @@ virtDBusDomainPinEmulator(GVariant *inArgs, g_autoptr(virDomain) domain =3D NULL; g_autoptr(GVariantIter) iter =3D NULL; guint flags; - guint cpus; guint cpumaplen; g_autofree guchar *cpumap =3D NULL; - gboolean usable; - guint cnt =3D 0; =20 g_variant_get(inArgs, "(abu)", &iter, &flags); =20 - cpus =3D g_variant_iter_n_children(iter); - cpumaplen =3D VIR_CPU_MAPLEN(cpus); - cpumap =3D g_new0(guchar, cpumaplen); - while (g_variant_iter_loop(iter, "b", &usable)) { - if (usable) - VIR_USE_CPU(cpumap, cnt); - cnt++; - } + virtDBusDomainGVariantToCpumap(iter, &cpumap, &cpumaplen); =20 domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); if (!domain) @@ -2036,22 +2045,12 @@ virtDBusDomainPinIOThread(GVariant *inArgs, guint iothreadId; g_autoptr(GVariantIter) iter =3D NULL; guint flags; - guint cpus; guint cpumaplen; g_autofree guchar *cpumap =3D NULL; - gboolean usable; - guint cnt =3D 0; =20 g_variant_get(inArgs, "(uabu)", &iothreadId, &iter, &flags); =20 - cpus =3D g_variant_iter_n_children(iter); - cpumaplen =3D VIR_CPU_MAPLEN(cpus); - cpumap =3D g_new0(guchar, cpumaplen); - while (g_variant_iter_loop(iter, "b", &usable)) { - if (usable) - VIR_USE_CPU(cpumap, cnt); - cnt++; - } + virtDBusDomainGVariantToCpumap(iter, &cpumap, &cpumaplen); =20 domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); if (!domain) @@ -2076,22 +2075,12 @@ virtDBusDomainPinVcpu(GVariant *inArgs, guint vcpu; g_autoptr(GVariantIter) iter =3D NULL; guint flags; - guint cpus; guint cpumaplen; g_autofree guchar *cpumap =3D NULL; - gboolean usable; - guint cnt =3D 0; =20 g_variant_get(inArgs, "(uabu)", &vcpu, &iter, &flags); =20 - cpus =3D g_variant_iter_n_children(iter); - cpumaplen =3D VIR_CPU_MAPLEN(cpus); - cpumap =3D g_new0(guchar, cpumaplen); - while (g_variant_iter_loop(iter, "b", &usable)) { - if (usable) - VIR_USE_CPU(cpumap, cnt); - cnt++; - } + virtDBusDomainGVariantToCpumap(iter, &cpumap, &cpumaplen); =20 domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); if (!domain) --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 05:27:08 2024 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 15256878728931019.3201075321605; Mon, 7 May 2018 03:11:12 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A2893356D3; Mon, 7 May 2018 10:11:09 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 703921001F50; Mon, 7 May 2018 10:11:09 +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 144174CAA7; Mon, 7 May 2018 10:11:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w47A6jnL023004 for ; Mon, 7 May 2018 06:06:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 65200111F3DB; Mon, 7 May 2018 10:06:45 +0000 (UTC) Received: from antique-work.brq.redhat.com (unknown [10.43.2.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id 09C5F111F3DA for ; Mon, 7 May 2018 10:06:44 +0000 (UTC) From: Pavel Hrdina To: libvir-list@redhat.com Date: Mon, 7 May 2018 12:06:36 +0200 Message-Id: <54ed38ac1b2ae76449b4b192928d91a5d9c96637.1525687535.git.phrdina@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH 9/9] util: Use spaces around operators 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 07 May 2018 10:11:11 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina --- src/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.c b/src/util.c index 8b28496..548fac8 100644 --- a/src/util.c +++ b/src/util.c @@ -177,7 +177,7 @@ virtDBusUtilEncodeUUID(const gchar *uuid) static gchar * virtDBusUtilDecodeUUID(const gchar *uuid) { - gchar *ret =3D g_strdup(uuid+1); + gchar *ret =3D g_strdup(uuid + 1); return g_strdelimit(ret, "_", '-'); } =20 --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list