From nobody Sun Feb 8 14:41:48 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 1549989748710111.76957361168718; Tue, 12 Feb 2019 08:42:28 -0800 (PST) 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 A47AEAC61E; Tue, 12 Feb 2019 16:42:25 +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 3DA1D5C6A6; Tue, 12 Feb 2019 16:42:25 +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 264C83F608; Tue, 12 Feb 2019 16:42:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1CGeW6Z004123 for ; Tue, 12 Feb 2019 11:40:32 -0500 Received: by smtp.corp.redhat.com (Postfix) id B8CC1D1CD; Tue, 12 Feb 2019 16:40:32 +0000 (UTC) Received: from lpt.brq.redhat.com (unknown [10.43.2.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3FFEC600C9 for ; Tue, 12 Feb 2019 16:40:32 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Tue, 12 Feb 2019 17:40:40 +0100 Message-Id: <1de240eace30315f944de8525185b5f18a5cbb5f.1549989584.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 6/6] Use NULLSTR_EMPTY even more 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: , Content-Type: text/plain; charset="utf-8" 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.28]); Tue, 12 Feb 2019 16:42:27 +0000 (UTC) This time even in places that would possibly better be served by a more complex macro. Can be squashed into the previous patch if requested. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Andrea Bolognani --- src/interface/interface_backend_netcf.c | 42 ++++++++++++------------- src/nwfilter/nwfilter_dhcpsnoop.c | 2 +- src/qemu/qemu_command.c | 4 +-- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/interface/interface_backend_netcf.c b/src/interface/interf= ace_backend_netcf.c index 27cc488f4b..cf8eb9488d 100644 --- a/src/interface/interface_backend_netcf.c +++ b/src/interface/interface_backend_netcf.c @@ -290,7 +290,7 @@ static struct netcf_if *interfaceDriverGetNetcfIF(struc= t netcf *ncf, virInterfac virReportError(netcf_to_vir_err(errcode), _("couldn't find interface named '%s': %s%s%s"), ifinfo->name, errmsg, details ? " - " : "", - details ? details : ""); + NULLSTR_EMPTY(details)); } else { virReportError(VIR_ERR_NO_INTERFACE, _("couldn't find interface named '%s'"), @@ -314,7 +314,7 @@ netcfInterfaceObjIsActive(struct netcf_if *iface, virReportError(netcf_to_vir_err(errcode), _("failed to get status of interface %s: %s%s%s"), ncf_if_name(iface), errmsg, details ? " - " : "", - details ? details : ""); + NULLSTR_EMPTY(details)); goto cleanup; } =20 @@ -346,7 +346,7 @@ static int netcfConnectNumOfInterfacesImpl(virConnectPt= r conn, virReportError(netcf_to_vir_err(errcode), _("failed to get number of host interfaces: %s%s%s"= ), errmsg, details ? " - " : "", - details ? details : ""); + NULLSTR_EMPTY(details)); goto cleanup; } =20 @@ -364,7 +364,7 @@ static int netcfConnectNumOfInterfacesImpl(virConnectPt= r conn, virReportError(netcf_to_vir_err(errcode), _("failed to list host interfaces: %s%s%s"), errmsg, details ? " - " : "", - details ? details : ""); + NULLSTR_EMPTY(details)); goto cleanup; } =20 @@ -380,7 +380,7 @@ static int netcfConnectNumOfInterfacesImpl(virConnectPt= r conn, virReportError(netcf_to_vir_err(errcode), _("couldn't find interface named '%s': %s%s= %s"), names[i], errmsg, - details ? " - " : "", details ? details : "= "); + details ? " - " : "", NULLSTR_EMPTY(details= )); goto cleanup; } else { /* Ignore the NETCF_NOERROR, as the interface is very like= ly @@ -436,7 +436,7 @@ static int netcfConnectListInterfacesImpl(virConnectPtr= conn, virReportError(netcf_to_vir_err(errcode), _("failed to get number of host interfaces: %s%s%s"= ), errmsg, details ? " - " : "", - details ? details : ""); + NULLSTR_EMPTY(details)); goto cleanup; } =20 @@ -454,7 +454,7 @@ static int netcfConnectListInterfacesImpl(virConnectPtr= conn, virReportError(netcf_to_vir_err(errcode), _("failed to list host interfaces: %s%s%s"), errmsg, details ? " - " : "", - details ? details : ""); + NULLSTR_EMPTY(details)); goto cleanup; } =20 @@ -475,7 +475,7 @@ static int netcfConnectListInterfacesImpl(virConnectPtr= conn, virReportError(netcf_to_vir_err(errcode), _("couldn't find interface named '%s': %s%s= %s"), allnames[i], errmsg, - details ? " - " : "", details ? details : "= "); + details ? " - " : "", NULLSTR_EMPTY(details= )); goto cleanup; } else { /* Ignore the NETCF_NOERROR, as the interface is very like= ly @@ -622,7 +622,7 @@ netcfConnectListAllInterfaces(virConnectPtr conn, virReportError(netcf_to_vir_err(errcode), _("failed to get number of host interfaces: %s%s%s"= ), errmsg, details ? " - " : "", - details ? details : ""); + NULLSTR_EMPTY(details)); goto cleanup; } =20 @@ -642,7 +642,7 @@ netcfConnectListAllInterfaces(virConnectPtr conn, virReportError(netcf_to_vir_err(errcode), _("failed to list host interfaces: %s%s%s"), errmsg, details ? " - " : "", - details ? details : ""); + NULLSTR_EMPTY(details)); goto cleanup; } =20 @@ -660,7 +660,7 @@ netcfConnectListAllInterfaces(virConnectPtr conn, virReportError(netcf_to_vir_err(errcode), _("couldn't find interface named '%s': %s%s= %s"), names[i], errmsg, - details ? " - " : "", details ? details : "= "); + details ? " - " : "", NULLSTR_EMPTY(details= )); goto cleanup; } else { /* Ignore the NETCF_NOERROR, as the interface is very like= ly @@ -740,7 +740,7 @@ static virInterfacePtr netcfInterfaceLookupByName(virCo= nnectPtr conn, virReportError(netcf_to_vir_err(errcode), _("couldn't find interface named '%s': %s%s%s"), name, errmsg, - details ? " - " : "", details ? details : ""); + details ? " - " : "", NULLSTR_EMPTY(details)); } else { virReportError(VIR_ERR_NO_INTERFACE, _("couldn't find interface named '%s'"), name); @@ -780,7 +780,7 @@ static virInterfacePtr netcfInterfaceLookupByMACString(= virConnectPtr conn, virReportError(netcf_to_vir_err(errcode), _("couldn't find interface with MAC address '%s': %= s%s%s"), macstr, errmsg, details ? " - " : "", - details ? details : ""); + NULLSTR_EMPTY(details)); goto cleanup; } if (niface =3D=3D 0) { @@ -844,7 +844,7 @@ static char *netcfInterfaceGetXMLDesc(virInterfacePtr i= finfo, virReportError(netcf_to_vir_err(errcode), _("could not get interface XML description: %s%s%s"= ), errmsg, details ? " - " : "", - details ? details : ""); + NULLSTR_EMPTY(details)); goto cleanup; } =20 @@ -906,7 +906,7 @@ static virInterfacePtr netcfInterfaceDefineXML(virConne= ctPtr conn, virReportError(netcf_to_vir_err(errcode), _("could not get interface XML description: %s%s%s"= ), errmsg, details ? " - " : "", - details ? details : ""); + NULLSTR_EMPTY(details)); goto cleanup; } =20 @@ -948,7 +948,7 @@ static int netcfInterfaceUndefine(virInterfacePtr ifinf= o) virReportError(netcf_to_vir_err(errcode), _("failed to undefine interface %s: %s%s%s"), ifinfo->name, errmsg, details ? " - " : "", - details ? details : ""); + NULLSTR_EMPTY(details)); goto cleanup; } =20 @@ -1000,7 +1000,7 @@ static int netcfInterfaceCreate(virInterfacePtr ifinf= o, virReportError(netcf_to_vir_err(errcode), _("failed to create (start) interface %s: %s%s%s"), ifinfo->name, errmsg, details ? " - " : "", - details ? details : ""); + NULLSTR_EMPTY(details)); goto cleanup; } =20 @@ -1052,7 +1052,7 @@ static int netcfInterfaceDestroy(virInterfacePtr ifin= fo, virReportError(netcf_to_vir_err(errcode), _("failed to destroy (stop) interface %s: %s%s%s"), ifinfo->name, errmsg, details ? " - " : "", - details ? details : ""); + NULLSTR_EMPTY(details)); goto cleanup; } =20 @@ -1115,7 +1115,7 @@ static int netcfInterfaceChangeBegin(virConnectPtr co= nn, unsigned int flags) virReportError(netcf_to_vir_err(errcode), _("failed to begin transaction: %s%s%s"), errmsg, details ? " - " : "", - details ? details : ""); + NULLSTR_EMPTY(details)); } =20 virObjectUnlock(driver); @@ -1140,7 +1140,7 @@ static int netcfInterfaceChangeCommit(virConnectPtr c= onn, unsigned int flags) virReportError(netcf_to_vir_err(errcode), _("failed to commit transaction: %s%s%s"), errmsg, details ? " - " : "", - details ? details : ""); + NULLSTR_EMPTY(details)); } =20 virObjectUnlock(driver); @@ -1165,7 +1165,7 @@ static int netcfInterfaceChangeRollback(virConnectPtr= conn, unsigned int flags) virReportError(netcf_to_vir_err(errcode), _("failed to rollback transaction: %s%s%s"), errmsg, details ? " - " : "", - details ? details : ""); + NULLSTR_EMPTY(details)); } =20 virObjectUnlock(driver); diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcp= snoop.c index 58f0057c3f..d8a1e7f8a8 100644 --- a/src/nwfilter/nwfilter_dhcpsnoop.c +++ b/src/nwfilter/nwfilter_dhcpsnoop.c @@ -579,7 +579,7 @@ virNWFilterSnoopReqNew(const char *ifkey) virReportError(VIR_ERR_INTERNAL_ERROR, _("virNWFilterSnoopReqNew called with invalid " "key \"%s\" (%zu)"), - ifkey ? ifkey : "", + NULLSTR_EMPTY(ifkey), ifkey ? strlen(ifkey) : 0); return NULL; } diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 13f193a31d..64d28b8751 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3726,9 +3726,9 @@ qemuBuildLegacyNicStr(virDomainNetDefPtr net) virMacAddrFormat(&net->mac, macaddr), net->info.alias, (net->model ? ",model=3D" : ""), - (net->model ? net->model : ""), + NULLSTR_EMPTY(net->model), (net->info.alias ? ",id=3D" : ""), - (net->info.alias ? net->info.alias : ""))); + NULLSTR_EMPTY(net->info.alias))); return str; } =20 --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list