From nobody Sun Feb 8 14:51:19 2026 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 1529642593941216.97061076666319; Thu, 21 Jun 2018 21:43:13 -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 6E6B7308626D; Fri, 22 Jun 2018 04:43:12 +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 399C36F116; Fri, 22 Jun 2018 04:43: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 DF86618037F4; Fri, 22 Jun 2018 04:43:11 +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 w5M4giJS022114 for ; Fri, 22 Jun 2018 00:42:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2757E1C700; Fri, 22 Jun 2018 04:42:44 +0000 (UTC) Received: from cv1.lan (ovpn-120-56.rdu2.redhat.com [10.10.120.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9DB7A1C70C; Fri, 22 Jun 2018 04:42:43 +0000 (UTC) From: Chris Venteicher To: libvir-list@redhat.com Date: Thu, 21 Jun 2018 23:42:07 -0500 Message-Id: <20180622044211.2212-9-cventeic@redhat.com> In-Reply-To: <20180622044211.2212-1-cventeic@redhat.com> References: <20180622044211.2212-1-cventeic@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: walling@linux.ibm.com, Chris Venteicher , david@redhat.com Subject: [libvirt] [PATCHv1 08/12] qemu_capabilities: QMPCommandPtr without shadow qmperr 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.49]); Fri, 22 Jun 2018 04:43:13 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Previously QMPCommandPtr (handle for issuing QMP commands) required an external char * qmperr to persist over the lifespan of QMPCommand to expose a QMP error string outside of QMPCommand. Specifically the external char *qmperr was required between calls to virQEMUCapsInitQMPCommandNew and virQEMUCapsInitQMPCommandAbort. This change allows the qmperr pointer to be maintained within the QMPCommand it's self avoiding the need to track the qmperr variable across a multi-function call lifespan of a QMPCommand. Q) Should we eliminate external qmperr completely as there seems to be no current use of qmperr outside the lifespan of QMPCommand in which an internal qmperr char pointer can persist and be used by anywhere we have access to the QMPCommandPtr? conversion functions removed '57d6df39bd'. --- src/qemu/qemu_capabilities.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 89a313b55d..f2202b652d 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -4242,6 +4242,7 @@ struct _virQEMUCapsInitQMPCommand { uid_t runUid; gid_t runGid; char **qmperr; + char *qmperr_internal; char *monarg; char *monpath; char *pidfile; @@ -4319,7 +4320,11 @@ virQEMUCapsInitQMPCommandNew(char *binary, =20 cmd->runUid =3D runUid; cmd->runGid =3D runGid; - cmd->qmperr =3D qmperr; + + if (qmperr) + cmd->qmperr =3D qmperr; /* external storage */ + else + cmd->qmperr =3D &cmd->qmperr_internal; /* cmd internal storage */ =20 /* the ".sock" sufix is important to avoid a possible clash with a qemu * domain called "capabilities" --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list