From nobody Mon Feb 9 04:46:10 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 158195967296871.67458969567792; Mon, 17 Feb 2020 09:14:32 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-75-Z01fed_EOYCdOFTimWSVXA-1; Mon, 17 Feb 2020 12:14:26 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1D95E100DFC1; Mon, 17 Feb 2020 17:14:18 +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 E4C4D19756; Mon, 17 Feb 2020 17:14:17 +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 79D2135B05; Mon, 17 Feb 2020 17:14:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01HHE9NQ018705 for ; Mon, 17 Feb 2020 12:14:09 -0500 Received: by smtp.corp.redhat.com (Postfix) id F39A610021B2; Mon, 17 Feb 2020 17:14:08 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 79B3610001AE for ; Mon, 17 Feb 2020 17:14:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581959671; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=SPLu4yk2zp+neIUQaHYqkjTT7NTb9kS3mL2vyQNIJS4=; b=Tg4QafUTIsKi4oApfi22m54MVkqw0kObbEjVp/fxpIBRwgJcxlhq8W1EGMw6IlCaTvs6UW 5zQnwxUIrRsJJOA6vq6nJI8HPWY+UsukTjE809i1OoEh/o63j0+OPYBrFJWeoV2eqkRaBl D7pVYDViMJpd4M12M+sNKI8j6J/Yf84= From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 4/9] virStorageFileGetMetadataRecurse: Expect NULL src->path Date: Mon, 17 Feb 2020 18:13:54 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com 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: , 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-MC-Unique: Z01fed_EOYCdOFTimWSVXA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The path can be NULL e.g. for NBD disks. Use NULLSTR to prevent use of NULL in %s. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/util/virstoragefile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index f8e4102588..cf37744d6f 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -4973,7 +4973,7 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr = src, g_autoptr(virStorageSource) backingStore =3D NULL; VIR_DEBUG("path=3D%s format=3D%d uid=3D%u gid=3D%u", - src->path, src->format, + NULLSTR(src->path), src->format, (unsigned int)uid, (unsigned int)gid); /* exit if we can't load information about the current image */ @@ -4995,7 +4995,7 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr = src, if (virHashLookup(cycle, uniqueName)) { virReportError(VIR_ERR_INTERNAL_ERROR, _("backing store for %s (%s) is self-referential"), - src->path, uniqueName); + NULLSTR(src->path), uniqueName); goto cleanup; } --=20 2.24.1