From nobody Mon Feb 9 06:27:14 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 ARC-Seal: i=1; a=rsa-sha256; t=1564002482; cv=none; d=zoho.com; s=zohoarc; b=AeeZFa0INwzEdRXMIEZySBjTmVvi8TkcAMb5WBqUqBOWst+QfnEWHZLaW3ifZVQUn5gSQgB0YrD6OHLDLXivpudCE32kiwcLh+v0VIYexvF8XDUsN2S2F53/LSQH1cAT5x1zpcEFeo7ZfYmOtq75ERDH1h4D6n0IeK8+5lwssek= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564002482; 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:ARC-Authentication-Results; bh=abGIdQOKtkK+QlMU9DsdPdyQDufxkN03dg8psM4nMEg=; b=UDBEuI38vO4Tf0DY44bcNY+VDXmsfzj/371hG5L2SAayx30yeERUULwGvoXz3o78mpzaS7lCvNHoZQFr9q0fX5gyiaCR7IenS9Ae/CULf/389R5EHhYz7DqiscOT+Pnvl9j1+bcu19xIDzX7fs+gr5GsQ1G/RYBlcnHBz4aIgJg= 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 156400248200453.951530801351396; Wed, 24 Jul 2019 14:08:02 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D807F3DBC5; Wed, 24 Jul 2019 21:08:00 +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 B5B3518EF7; Wed, 24 Jul 2019 21:08:00 +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 7DDC9180020F; Wed, 24 Jul 2019 21:08:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6OL7j4g003699 for ; Wed, 24 Jul 2019 17:07:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 801785D967; Wed, 24 Jul 2019 21:07:45 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0B6CD5DA34 for ; Wed, 24 Jul 2019 21:07:44 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 24 Jul 2019 23:07:34 +0200 Message-Id: <73c5a0d2b85672696f0f9d297e36d7a4561d644f.1564002117.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 7/9] qemu: blockjob: Ensure that config disk source is identical when modifying it 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 24 Jul 2019 21:08:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" qemuBlockJobRewriteConfigDiskSource rewrites the disk source only according to the 'target'. This means that if someone would change the inactive config of the VM to refer to a different disk a block job would rewrite it when finishing a job which modifies the disk source. Make sure that this does not happen by verifying that the source of the config disk is the same. Signed-off-by: Peter Krempa --- src/qemu/qemu_blockjob.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index f5574b7e03..0c0ae89f10 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -479,6 +479,9 @@ qemuBlockJobRewriteConfigDiskSource(virDomainObjPtr vm, if (!(persistDisk =3D virDomainDiskByName(vm->newDef, disk->dst, false= ))) return; + if (!virStorageSourceIsSameLocation(disk->src, persistDisk->src)) + return; + if (!(copy =3D virStorageSourceCopy(newsrc, false)) || virStorageSourceInitChainElement(copy, persistDisk->src, true) < 0= ) { VIR_WARN("Unable to update persistent definition on vm %s after bl= ock job", --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list