From nobody Fri Dec 19 06:38:47 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 ARC-Seal: i=1; a=rsa-sha256; t=1571415107; cv=none; d=zoho.com; s=zohoarc; b=dw+WzLCx8SCjIJn33P3XdFz+zuzobK//XDM/E1efhek0UkEXoBiqNVkZNXShbNWCFvT58aKnu8OprTvzBAKWX3ThEy2meF8clSw//JakY8e2QX9wsEmKsjiYwwFnK+t1KVE8epHAA8socwK0Kx77BYBSHsQHhf6osO/igs8YC2c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571415107; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ukOes2Sfl6+biy408cJ/rXqyDYDxjLXxkWu88iVHBi8=; b=jaDHxsVJ+9xiWZwYQmRCH4hIy102sEIs7CI7HqhYynFbqdPuffxm+m0aUTwwmCl37DxNNks/A+Ybg0pMEDjE17vRdcGzAUauQxODtx1G5wCgCWUxgkFN77bRUMenf73OSdfZDEjyTM2fdZEAWe+4Z3K47W9yz3TOde5E2dszV9I= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571415107911397.9158418720717; Fri, 18 Oct 2019 09:11:47 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E05773092651; Fri, 18 Oct 2019 16:11:45 +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 B7E375DD61; Fri, 18 Oct 2019 16:11:45 +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 5EDDF180BA9E; Fri, 18 Oct 2019 16:11:45 +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 x9IGBaJl004582 for ; Fri, 18 Oct 2019 12:11:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id 41FD7600D1; Fri, 18 Oct 2019 16:11:36 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 98F8D600C8; Fri, 18 Oct 2019 16:11:35 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 18 Oct 2019 18:10:52 +0200 Message-Id: <7a2df5f187675f6a6efedf0db00d94480829f77f.1571414890.git.pkrempa@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 RFC 07/40] qemu: domain: Tolerate NULL @disk in qemuDomainPrepareDiskSourceData 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-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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Fri, 18 Oct 2019 16:11:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" In some cases we want to prepare a @src which is not meant to belong to a disk and thus does not require us to copy the data. Allow passing in NULL @disk into qemuDomainPrepareDiskSourceData. Signed-off-by: Peter Krempa Reviewed-by: Daniel Henrique Barboza --- src/qemu/qemu_domain.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 259cf51e2b..3deb69cb63 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -15095,6 +15095,9 @@ void qemuDomainPrepareDiskSourceData(virDomainDiskDefPtr disk, virStorageSourcePtr src) { + if (!disk) + return; + /* transfer properties valid only for the top level image */ if (src =3D=3D disk->src) src->detect_zeroes =3D disk->detect_zeroes; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list