From nobody Sun Feb 8 14:22:49 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=1567519735; cv=none; d=zoho.com; s=zohoarc; b=mzZQFMZVpxdrKUtRo0SphsvDhzHMGHM/9dlJHqRB7XX+Zs+948UUX0Y9U4ehhj+AzwV+0Qh4eOuDnCC+Z6QWZxqfYufEoQA1Fw50M1tUn0Ds5RhOti/jsowPiaJVoZU+PL/WWxYgBArUBaOUrbagF91bZFP8RWganNmEWlKuz3s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567519735; 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=rYYVXzEgZh3y8L36JQmvlZ37QeynYJbVWS8q95A1pZA=; b=OEVn5ky0OhhJ27ZCWn+LhEJ9mcTVFRCeRBiTPXUcEDuB6Se6WbfJMjIeua401P9fR0DtTJuh9+8RC6l/S48RE6mdv+Xxfl0zw2+osz4ZS/6txiV+zyGlb9zju6UhejpZEfEeSYIcRnsp0a7AOl7ktVikLaFxFMe36IB+Ftieed8= 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 156751973536697.88524416785503; Tue, 3 Sep 2019 07:08:55 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 957F23A17F; Tue, 3 Sep 2019 14:08:53 +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 7154C60C57; Tue, 3 Sep 2019 14:08:53 +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 3354924F37; Tue, 3 Sep 2019 14:08:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x83E8LMU009583 for ; Tue, 3 Sep 2019 10:08:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id 171CE10016EB; Tue, 3 Sep 2019 14:08:21 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 948141001B05 for ; Tue, 3 Sep 2019 14:08:20 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 3 Sep 2019 16:08:00 +0200 Message-Id: <7eebb4d30f20353446adce85b9490db3d2d7c3cd.1567519340.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 07/18] qemu: block: explicitly pass backing store to qemuBlockStorageSourceAttachPrepareBlockdev 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 03 Sep 2019 14:08:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Pass backing store as an argument rather than extracting it locally and fix the callers. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 4 +++- src/qemu/qemu_block.h | 1 + src/qemu/qemu_command.c | 2 +- src/qemu/qemu_migration.c | 4 +++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index fb631276c9..4b5dd30e17 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1464,6 +1464,7 @@ qemuBlockStorageSourceAttachDataFree(qemuBlockStorage= SourceAttachDataPtr data) /** * qemuBlockStorageSourceAttachPrepareBlockdev: * @src: storage source to prepare data from + * @backingStore: storage source to use as backing of @src * @autoreadonly: use 'auto-read-only' feature of qemu * * Creates a qemuBlockStorageSourceAttachData structure containing data to= attach @@ -1478,6 +1479,7 @@ qemuBlockStorageSourceAttachDataFree(qemuBlockStorage= SourceAttachDataPtr data) */ qemuBlockStorageSourceAttachDataPtr qemuBlockStorageSourceAttachPrepareBlockdev(virStorageSourcePtr src, + virStorageSourcePtr backingSto= re, bool autoreadonly) { VIR_AUTOPTR(qemuBlockStorageSourceAttachData) data =3D NULL; @@ -1486,7 +1488,7 @@ qemuBlockStorageSourceAttachPrepareBlockdev(virStorag= eSourcePtr src, return NULL; if (!(data->formatProps =3D qemuBlockStorageSourceGetBlockdevProps(src, - src->= backingStore)) || + backi= ngStore)) || !(data->storageProps =3D qemuBlockStorageSourceGetBackendProps(src= , false, false, autor= eadonly))) diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h index 8c96a9b940..2de614b159 100644 --- a/src/qemu/qemu_block.h +++ b/src/qemu/qemu_block.h @@ -109,6 +109,7 @@ VIR_DEFINE_AUTOPTR_FUNC(qemuBlockStorageSourceAttachDat= a, qemuBlockStorageSourceAttachDataPtr qemuBlockStorageSourceAttachPrepareBlockdev(virStorageSourcePtr src, + virStorageSourcePtr backingSto= re, bool autoreadonly); qemuBlockStorageSourceAttachDataPtr diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 05c35919bf..fa8bf39359 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10727,7 +10727,7 @@ qemuBuildStorageSourceChainAttachPrepareBlockdevOne= (qemuBlockStorageSourceChainD { VIR_AUTOPTR(qemuBlockStorageSourceAttachData) elem =3D NULL; - if (!(elem =3D qemuBlockStorageSourceAttachPrepareBlockdev(src, true))) + if (!(elem =3D qemuBlockStorageSourceAttachPrepareBlockdev(src, src->b= ackingStore, true))) return -1; if (qemuBuildStorageSourceAttachPrepareCommon(src, elem, qemuCaps) < 0) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index bd40a8e70d..e387deb497 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -832,7 +832,9 @@ qemuMigrationSrcNBDStorageCopyBlockdev(virQEMUDriverPtr= driver, /* Migration via blockdev-mirror was supported sooner than the auto-re= ad-only * feature was added to qemu */ - if (!(data =3D qemuBlockStorageSourceAttachPrepareBlockdev(copysrc, fa= lse))) + if (!(data =3D qemuBlockStorageSourceAttachPrepareBlockdev(copysrc, + copysrc->back= ingStore, + false))) goto cleanup; if (qemuDomainObjEnterMonitorAsync(driver, vm, --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list