From nobody Wed Jan 15 11:48:09 2025 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=quarantine dis=quarantine) header.from=swemel.ru Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1704898055972541.7128453779661; Wed, 10 Jan 2024 06:47:35 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id E64E81BCE; Wed, 10 Jan 2024 09:47:34 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id EC13A1CF3; Wed, 10 Jan 2024 09:24:40 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id DBF1C1C2F; Wed, 10 Jan 2024 09:23:22 -0500 (EST) Received: from mx.swemel.ru (mx.swemel.ru [95.143.211.150]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 692181C2A for ; Wed, 10 Jan 2024 09:21:59 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 From: Dmitry Frolov To: devel@lists.libvirt.org Subject: [PATCH v4 14/19] libxl: change type to void virDomainGraphicsListenAppendAddress() Date: Wed, 10 Jan 2024 17:21:29 +0300 Message-Id: <20240110142134.915450-15-frolov@swemel.ru> In-Reply-To: <20240110142134.915450-1-frolov@swemel.ru> References: <47d3cbc0-003b-4829-8038-8e00bbdb5c85@redhat.com> <20240110142134.915450-1-frolov@swemel.ru> MIME-Version: 1.0 Message-ID-Hash: CFAM6MVDOKADQHGBAO2N6PEZDKO7QZS7 X-Message-ID-Hash: CFAM6MVDOKADQHGBAO2N6PEZDKO7QZS7 X-MailFrom: frolov@swemel.ru X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: sdl.libvirt@linuxtesting.org, Dmitry Frolov X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1704898057546100001 virDomainGraphicsListenAppendAddress() returns nothing except 0. Changing return type to void. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Frolov --- src/conf/domain_conf.c | 4 +--- src/conf/domain_conf.h | 2 +- src/libxl/xen_common.c | 8 +++----- src/libxl/xen_xl.c | 3 +-- src/vbox/vbox_common.c | 9 ++------- src/vmx/vmx.c | 3 +-- 6 files changed, 9 insertions(+), 20 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e232d635bb..bd8d941f34 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -29153,7 +29153,7 @@ virDomainGraphicsGetListen(virDomainGraphicsDef *de= f, size_t i) } =20 =20 -int +void virDomainGraphicsListenAppendAddress(virDomainGraphicsDef *def, const char *address) { @@ -29164,8 +29164,6 @@ virDomainGraphicsListenAppendAddress(virDomainGraph= icsDef *def, glisten.address =3D g_strdup(address); =20 VIR_APPEND_ELEMENT_COPY(def->listens, def->nListens, glisten); - - return 0; } =20 =20 diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 89257d33fc..6b70a599f1 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3912,7 +3912,7 @@ int virDomainHostdevMatch(virDomainHostdevDef *a, =20 virDomainGraphicsListenDef * virDomainGraphicsGetListen(virDomainGraphicsDef *def, size_t i); -int virDomainGraphicsListenAppendAddress(virDomainGraphicsDef *def, +void virDomainGraphicsListenAppendAddress(virDomainGraphicsDef *def, const char *address) ATTRIBUTE_NONNULL(1); int virDomainGraphicsListenAppendSocket(virDomainGraphicsDef *def, diff --git a/src/libxl/xen_common.c b/src/libxl/xen_common.c index ba2a322016..8f4add7f30 100644 --- a/src/libxl/xen_common.c +++ b/src/libxl/xen_common.c @@ -673,8 +673,7 @@ xenParseVfb(virConf *conf, virDomainDef *def) =20 if (xenConfigCopyStringOpt(conf, "vnclisten", &listenAddr) < 0) goto cleanup; - if (virDomainGraphicsListenAppendAddress(graphics, listenAddr)= < 0) - goto cleanup; + virDomainGraphicsListenAppendAddress(graphics, listenAddr); VIR_FREE(listenAddr); =20 if (xenConfigCopyStringOpt(conf, "vncpasswd", &graphics->data.= vnc.auth.passwd) < 0) @@ -766,9 +765,8 @@ xenParseVfb(virConf *conf, virDomainDef *def) key =3D nextkey; } if (graphics->type =3D=3D VIR_DOMAIN_GRAPHICS_TYPE_VNC) { - if (virDomainGraphicsListenAppendAddress(graphics, - listenAddr) < 0) - goto cleanup; + virDomainGraphicsListenAppendAddress(graphics, + listenAddr); VIR_FREE(listenAddr); } def->graphics =3D g_new0(virDomainGraphicsDef *, 1); diff --git a/src/libxl/xen_xl.c b/src/libxl/xen_xl.c index f175359307..553aa77896 100644 --- a/src/libxl/xen_xl.c +++ b/src/libxl/xen_xl.c @@ -341,8 +341,7 @@ xenParseXLSpice(virConf *conf, virDomainDef *def) graphics->type =3D VIR_DOMAIN_GRAPHICS_TYPE_SPICE; if (xenConfigCopyStringOpt(conf, "spicehost", &listenAddr) < 0) goto cleanup; - if (virDomainGraphicsListenAppendAddress(graphics, listenAddr)= < 0) - goto cleanup; + virDomainGraphicsListenAppendAddress(graphics, listenAddr); =20 if (xenConfigGetULong(conf, "spicetls_port", &port, 0) < 0) goto cleanup; diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index de3c9989a5..59e7a91081 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -3549,7 +3549,6 @@ vboxDumpDisplay(virDomainDef *def, struct _vboxDriver= *data, IMachine *machine) IVRDEServer *VRDEServer =3D NULL; PRBool VRDxEnabled =3D PR_FALSE; virDomainGraphicsDef *graphics =3D NULL; - int ret =3D -1; =20 def->ngraphics =3D 0; =20 @@ -3625,8 +3624,7 @@ vboxDumpDisplay(virDomainDef *def, struct _vboxDriver= *data, IMachine *machine) if (netAddressUtf8 && STREQ(netAddressUtf8, "")) VBOX_UTF8_FREE(netAddressUtf8); =20 - if (virDomainGraphicsListenAppendAddress(graphics, netAddressUtf8)= < 0) - goto cleanup; + virDomainGraphicsListenAppendAddress(graphics, netAddressUtf8); =20 gVBoxAPI.UIVRDEServer.GetAllowMultiConnection(VRDEServer, &allowMu= ltiConnection); if (allowMultiConnection) @@ -3639,14 +3637,11 @@ vboxDumpDisplay(virDomainDef *def, struct _vboxDriv= er *data, IMachine *machine) VIR_APPEND_ELEMENT(def->graphics, def->ngraphics, graphics); } =20 - ret =3D 0; - - cleanup: VBOX_RELEASE(VRDEServer); VBOX_UTF8_FREE(valueTypeUtf8); VBOX_UTF8_FREE(netAddressUtf8); virDomainGraphicsDefFree(graphics); - return ret; + return 0; } =20 static int diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 26b89776e1..e746ff213b 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -2017,8 +2017,7 @@ virVMXParseVNC(virConf *conf, virDomainGraphicsDef **= def) goto failure; } =20 - if (virDomainGraphicsListenAppendAddress(*def, listenAddr) < 0) - goto failure; + virDomainGraphicsListenAppendAddress(*def, listenAddr); VIR_FREE(listenAddr); =20 if (port < 0) { --=20 2.34.1 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org