From nobody Tue Apr 30 04:50:01 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1512660482669757.9253597950619; Thu, 7 Dec 2017 07:28:02 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DE59B8765D; Thu, 7 Dec 2017 15:27:59 +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 156EA5EDE8; Thu, 7 Dec 2017 15:27:59 +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 765464BB79; Thu, 7 Dec 2017 15:27:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vB7FRtZL029892 for ; Thu, 7 Dec 2017 10:27:55 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1903F784B1; Thu, 7 Dec 2017 15:27:55 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 67251784B2; Thu, 7 Dec 2017 15:27:51 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 7 Dec 2017 16:27:23 +0100 Message-Id: <0c57ff3c980d883ee8bfe51dcdc9c249bd93a2fb.1512660443.git.pkrempa@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH] qemu: blockjob: Reset disk source index after pivot 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: , MIME-Version: 1.0 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 07 Dec 2017 15:28:01 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Since we are re-detecting the backing chain after pivoting to the active block commit target (or block copy target) the disk index needs to be reset to 0. This is necessary since we move a member of the backing chain to disk->src but clear indexes only starting from disk->src->backingStore. The freshly detected images have indexes starting from 1, but since we've pivoted into an image which was previously a backing store it would have a non-0 index. The lookup function would then return the top of the chain for queries like 'vda[1]' instead of the first backing store. This problem will not be present once we keep the disk indexes stable. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1519745 --- src/qemu/qemu_blockjob.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 0b1616a214..617e4ee564 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -175,6 +175,7 @@ qemuBlockJobEventProcess(virQEMUDriverPtr driver, disk->mirror =3D NULL; disk->mirrorState =3D VIR_DOMAIN_DISK_MIRROR_STATE_NONE; disk->mirrorJob =3D VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN; + disk->src->id =3D 0; ignore_value(qemuDomainDetermineDiskChain(driver, vm, disk, true, true)); ignore_value(qemuBlockNodeNamesDetect(driver, vm, asyncJob)); --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list