From nobody Tue Feb 10 04:17:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1679914048; cv=none; d=zohomail.com; s=zohoarc; b=JFNySw5RvMuQAleOtprnx2Wszd5J7MU9qrvSO5hTlc9VuHYRefwICA7Lz0Nv9P/QQqFnX1NMjgGUPIl2G3P0RjLvO7EjVtNjBzXaqET+uaorcgUwgdiL8EPJUvKcx78EygyP3SQOJjU2ylJu/QCGdKYI+Qf0k0XEeDatnQaNK4A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1679914048; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=c4hbRJvMjTV+9CZLvFWzjw7lNkLTJW9m4/jYcfZH53E=; b=UHZ+VD6y3wiwhqm/27E8gBljgaoU9lLSyzBaX8sx2/dD2L1D/rymeSuxPed3dkU/j/0Sk6x2U6JisX8Nm9uKcHMzMqlQfQwjRU/YNN7iO9vTVgXS+L9DCvNF188Xw5JcJoLEd4sPMAurqc1mFZc9iCZ/XD6SPvWl0eiY1d88IKU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 16799140485597.3554165144875014; Mon, 27 Mar 2023 03:47:28 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-461-wNshrbcfPdeEnN9skc-uPg-1; Mon, 27 Mar 2023 06:47:26 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1CB363C10146; Mon, 27 Mar 2023 10:47:24 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8DE33C15BA0; Mon, 27 Mar 2023 10:47:22 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5CF7419465A4; Mon, 27 Mar 2023 10:47:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A1FEE1946594 for ; Mon, 27 Mar 2023 10:47:20 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 30CA92166B29; Mon, 27 Mar 2023 10:47:20 +0000 (UTC) Received: from localhost.localdomain (unknown [10.45.226.208]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4DF22166B26 for ; Mon, 27 Mar 2023 10:47:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679914047; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=c4hbRJvMjTV+9CZLvFWzjw7lNkLTJW9m4/jYcfZH53E=; b=D1tOUhjO2dOe4wsOBwqM4UaCmUaonkgCHA/ZYjZCVshm9eLT7gmnYzbqxCXmOrL4oUXnYS mV1muv6iSO/9icTAJ8LbbDzAhah9pvDErLaDz8eLtonM4xSIAATaeufixbN9obfDeFwXUa qz4kCCg9iUYlYHPVzd1eWJYcao44zNo= X-MC-Unique: wNshrbcfPdeEnN9skc-uPg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH] qemu_snapshot: external: don't error out when updating metadata Date: Mon, 27 Mar 2023 12:47:11 +0200 Message-Id: <1057de723e990f20803e5f5055a4788f6e672962.1679914011.git.phrdina@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1679914049999100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Attaching disk into running VM the offilne definition may not be updated and we will end up with that disk existing only in live definition. Creating snapshot with this state saves both live and offline definition into snapshot metadata. When we are deleting an external snapshot we are updating these definitions in the snapshot metadata so we should just skip over non-existing disks instead of reporting error. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2174700 Signed-off-by: Pavel Hrdina Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_snapshot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 14353c6f0d..e36d6288ac 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -2464,8 +2464,8 @@ qemuSnapshotUpdateDisksSingle(virDomainMomentObj *sna= p, { virDomainDiskDef *disk =3D NULL; =20 - if (!(disk =3D qemuDomainDiskByName(def, snapDisk->name))) - return -1; + if (!(disk =3D virDomainDiskByName(def, snapDisk->name, true))) + return 0; =20 if (virDomainSnapshotIsExternal(snap)) { virDomainDiskDef *parentDisk =3D NULL; --=20 2.39.2