From nobody Thu May 15 07:06:23 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 152778787601866.45650784573786; Thu, 31 May 2018 10:31:16 -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 39B50C093542; Thu, 31 May 2018 17:31:13 +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 F3DE830012C7; Thu, 31 May 2018 17:31:12 +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 9A6154BB78; Thu, 31 May 2018 17:31:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4VHUefw030252 for ; Thu, 31 May 2018 13:30:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id BCBEA208C6C2; Thu, 31 May 2018 17:30:39 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 61007208C6C1 for ; Thu, 31 May 2018 17:30:39 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 31 May 2018 19:30:24 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/4] qemu: command: Return props as return value in qemuBuildPRManagerInfoProps 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.32]); Thu, 31 May 2018 17:31:14 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Also since we don't do any conditional formatting, fix the comment for the function. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_command.c | 22 +++++++++++----------- src/qemu/qemu_command.h | 3 +-- src/qemu/qemu_hotplug.c | 5 ++++- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 9256104f27..2d559938ed 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -9692,20 +9692,20 @@ qemuBuildPanicCommandLine(virCommandPtr cmd, /** * qemuBuildPRManagerInfoProps: * @src: storage source - * @propsret: Returns JSON object containing properties of the pr-manager-= helper object * * Build the JSON properties for the pr-manager object. - * - * Returns: 0 on success (@propsret is NULL if no properties are needed), - * -1 on failure (with error message set). */ -int -qemuBuildPRManagerInfoProps(virStorageSourcePtr src, - virJSONValuePtr *propsret) +virJSONValuePtr +qemuBuildPRManagerInfoProps(virStorageSourcePtr src) { - return qemuMonitorCreateObjectProps(propsret, - "pr-manager-helper", src->pr->mgra= lias, - "s:path", src->pr->path, NULL); + virJSONValuePtr ret =3D NULL; + + if (qemuMonitorCreateObjectProps(&ret, + "pr-manager-helper", src->pr->mgralia= s, + "s:path", src->pr->path, NULL) < 0) + return NULL; + + return ret; } @@ -9732,7 +9732,7 @@ qemuBuildMasterPRCommandLine(virCommandPtr cmd, managedAdded =3D true; } - if (qemuBuildPRManagerInfoProps(disk->src, &props) < 0) + if (!(props =3D qemuBuildPRManagerInfoProps(disk->src))) goto cleanup; if (virQEMUBuildObjectCommandlineFromJSON(&buf, props) < 0) diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index 60b4dcf054..10aa21bcdd 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -55,8 +55,7 @@ virCommandPtr qemuBuildCommandLine(virQEMUDriverPtr drive= r, int **nicindexes); /* Generate the object properties for pr-manager */ -int qemuBuildPRManagerInfoProps(virStorageSourcePtr src, - virJSONValuePtr *propsret); +virJSONValuePtr qemuBuildPRManagerInfoProps(virStorageSourcePtr src); /* Generate the object properties for a secret */ int qemuBuildSecretInfoProps(qemuDomainSecretInfoPtr secinfo, diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 44bd41ccb6..e78aff7adf 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -401,7 +401,10 @@ qemuMaybeBuildPRManagerInfoProps(virDomainObjPtr vm, return 0; } - return qemuBuildPRManagerInfoProps(disk->src, propsret); + if (!(*propsret =3D qemuBuildPRManagerInfoProps(disk->src))) + return -1; + + return 0; } --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list