From nobody Wed May 14 06:38:03 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 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