From nobody Sat Feb 7 05:40:37 2026 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 Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1714395590734794.6538646799575; Mon, 29 Apr 2024 05:59:50 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 652FC18BE; Mon, 29 Apr 2024 08:59:49 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 218BB1E27; Mon, 29 Apr 2024 08:59:12 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 70A021E1A; Mon, 29 Apr 2024 08:59:08 -0400 (EDT) Received: from relay.virtuozzo.com (relay.virtuozzo.com [130.117.225.111]) (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 A51C21E1A for ; Mon, 29 Apr 2024 08:59:06 -0400 (EDT) Received: from ch-vpn.virtuozzo.com ([130.117.225.6] helo=localhost.localdomain) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1s1QIf-00Fs4X-16; Mon, 29 Apr 2024 14:43:24 +0200 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 X-Greylist: delayed 931 seconds by postgrey-1.37 at lists.libvirt.org; Mon, 29 Apr 2024 08:59:06 EDT To: devel@lists.libvirt.org Subject: [PATCH] =?UTF-8?q?=D0=A1heck=20snapshot=20disk=20is=20not=20NULL?= =?UTF-8?q?=20when=20searching=20it=20in=20the=20VM=20config?= Date: Mon, 29 Apr 2024 20:43:26 +0800 Message-Id: <20240429124326.118051-1-efim.shevrin@virtuozzo.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Message-ID-Hash: YY5RURK6AFQNNB7LEH5KMFDTP5ZDSTVD X-Message-ID-Hash: YY5RURK6AFQNNB7LEH5KMFDTP5ZDSTVD X-MailFrom: efim.shevrin@virtuozzo.com X-Mailman-Rule-Hits: nonmember-moderation 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 CC: efim.shevrin@virtuozzo.com, den@openvz.org 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: From: Fima Shevrin via Devel Reply-To: Fima Shevrin Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1714395592106100001 When creating a snapshot of a VM with multiple hard disks, the snapshot takes into account the presence of all disks in the system. If, over time, one of the disks is deleted, the snapshot will continue to store knowledge of the deleted disk. This results in the fact that at the moment of deleting the snapshot, at the validation stage, a disk from the snapshot will be searched which is not in the VM configuration. As a result, vmdisk variable will be equal to NULL. Dereferencing a null pointer at the time of calling virStorageSourceIsSameLocation(vmdisk->src, disk->src) will result in SIGSE= GV. Signed-off-by: Fima Shevrin --- src/qemu/qemu_snapshot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 09ec959f10..bf93cd485e 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -3806,7 +3806,7 @@ qemuSnapshotDeleteValidate(virDomainObj *vm, vmdisk =3D qemuDomainDiskByName(vm->def, snapDisk->name); disk =3D qemuDomainDiskByName(snapdef->parent.dom, snapDisk->n= ame); =20 - if (!virStorageSourceIsSameLocation(vmdisk->src, disk->src)) { + if (vmdisk !=3D NULL && !virStorageSourceIsSameLocation(vmdisk= ->src, disk->src)) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, _("disk image '%1$s' for internal snapshot = '%2$s' is not the same as disk image currently used by VM"), snapDisk->name, snap->def->name); --=20 2.34.1 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org