From nobody Tue Apr 30 16:01:09 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563883749; cv=none; d=zoho.com; s=zohoarc; b=gf/91d6/x/zRVbNpK7GmOcJwpgbJKNqNCVUDYsZ/OnqL14iDtB2ZZEAVATeoArKCC3yE/E7CQXMWk53CvgS68e0BN1RIO3UELaGPUk8Lp/OgPKSbQUiAznAZZ7RIOr6Wj+xvB5Q92b29JR3Pslhz8jDfPS21SIzyitWFQdIkwWU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563883749; 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=87FTdMJIJ+LFZyTpOSFd6bKsaekvkZuT2hdiA/2ZjR8=; b=hC0vctRayRWc203UmAWaslnI7dB4RvcYepRQ1lx+QjKmBdIjs0eWgEOpVmb3ESZ9HKh0EYdFYM+GVE94S06ZzVAazWz+JmgmekVLOpuveACLpHuhRmDajYY5dwyC+YxyL2r8Y2Xsc9aUZgAmxFIBnOcS8o5ZM/pqzfnaKyvcWFo= 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 1563883749178718.577101300706; Tue, 23 Jul 2019 05:09:09 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D64D559455; Tue, 23 Jul 2019 12:09:07 +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 B3B475D9D3; Tue, 23 Jul 2019 12:09:07 +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 73677180020A; Tue, 23 Jul 2019 12:09:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6NC8tHM009406 for ; Tue, 23 Jul 2019 08:08:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8CC9D5B685; Tue, 23 Jul 2019 12:08:55 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 193135B684 for ; Tue, 23 Jul 2019 12:08:54 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 23 Jul 2019 14:08:45 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/7] qemu: command: Fix function name in comment 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 23 Jul 2019 12:09:08 +0000 (UTC) Content-Type: text/plain; charset="utf-8" In commit 042c95bd194 qemuBuildStorageSourceChainAttachPrepareBlockdev was added but the comment for the function mentions qemuBuildStorageSourceChainAttachPrepareDrive. Fix the mistake. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 1cf165079f..eefec98022 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -11160,7 +11160,7 @@ qemuBuildStorageSourceChainAttachPrepareDrive(virDo= mainDiskDefPtr disk, /** - * qemuBuildStorageSourceChainAttachPrepareDrive: + * qemuBuildStorageSourceChainAttachPrepareBlockdev: * @top: storage source chain * @qemuCaps: qemu capabilities object * --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 16:01:09 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563883752; cv=none; d=zoho.com; s=zohoarc; b=YKKVy2BYW3M1daDibtULAo8BEhUVU+ty50zYx4c+TakARRNW6AALFpJA8fEsvHOkcNg+AhGN/LuAq0eRIPrkKd3UY3OUuu6ia53jBu2MI0y2+hcIPAdolLcEOx+LBk9jjByqlyQdICcj6gxf8bPaOInQeyJM62nbAqR56OX6Cvg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563883752; 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=8m50N3HMUwxAKlrfnmeguRIPgRNKBQ+7f0NnuQW4+xY=; b=BrfqLmT+vKNwhwixTwvR4qFGCS7st9iNJsvCjsQPJA5rwvh7LwUu/pX4g3zMaCmEHE9SHc3zipRKFxS80lLjwd+VdLseBU0nWz7CwNpwFuyjVmXmBMhikHbPJ2+egfgdsyPruwhPQPd0yBCGEtrewQfMoAzjvcFXzHq5mIAQQUI= 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 1563883752698693.5564784032703; Tue, 23 Jul 2019 05:09:12 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7E35D81F18; Tue, 23 Jul 2019 12:09:11 +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 082185D9D3; Tue, 23 Jul 2019 12:09:11 +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 B081A1972E; Tue, 23 Jul 2019 12:09:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6NC8u3S009414 for ; Tue, 23 Jul 2019 08:08:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id B36B652FC2; Tue, 23 Jul 2019 12:08:56 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id D8F4A5B684 for ; Tue, 23 Jul 2019 12:08:55 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 23 Jul 2019 14:08:46 +0200 Message-Id: <5284a2451c01dacfcdb2fcba95239290c0ef12e9.1563883655.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/7] qemu: Add possibility to prepare top image only for attachment via blockdev 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 23 Jul 2019 12:09:12 +0000 (UTC) Content-Type: text/plain; charset="utf-8" qemuBuildStorageSourceChainAttachPrepareBlockdev prepares the full backing chain for attachment via blockdev. For snapshots we'll need to prepare one image only as it needs to be plugged on top of the existing chain. This patch introduces qemuBuildStorageSourceChainAttachPrepareBlockdevTop which prepares only @top similarly to the original function by splitting out the functionality into an internal function so that the API does not change. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 51 +++++++++++++++++++++++++++++++++-------- src/qemu/qemu_command.h | 3 +++ 2 files changed, 44 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index eefec98022..476e710257 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -11159,16 +11159,10 @@ qemuBuildStorageSourceChainAttachPrepareDrive(vir= DomainDiskDefPtr disk, } -/** - * qemuBuildStorageSourceChainAttachPrepareBlockdev: - * @top: storage source chain - * @qemuCaps: qemu capabilities object - * - * Prepares qemuBlockStorageSourceChainDataPtr for attaching @top via -blo= ckdev. - */ -qemuBlockStorageSourceChainDataPtr -qemuBuildStorageSourceChainAttachPrepareBlockdev(virStorageSourcePtr top, - virQEMUCapsPtr qemuCaps) +static qemuBlockStorageSourceChainDataPtr +qemuBuildStorageSourceChainAttachPrepareBlockdevInternal(virStorageSourceP= tr top, + virQEMUCapsPtr qe= muCaps, + bool onlyTop) { VIR_AUTOPTR(qemuBlockStorageSourceAttachData) elem =3D NULL; VIR_AUTOPTR(qemuBlockStorageSourceChainData) data =3D NULL; @@ -11186,7 +11180,44 @@ qemuBuildStorageSourceChainAttachPrepareBlockdev(v= irStorageSourcePtr top, if (VIR_APPEND_ELEMENT(data->srcdata, data->nsrcdata, elem) < 0) return NULL; + + if (onlyTop) + break; } VIR_RETURN_PTR(data); } + + +/** + * qemuBuildStorageSourceChainAttachPrepareBlockdev: + * @top: storage source chain + * @qemuCaps: qemu capabilities object + * + * Prepares qemuBlockStorageSourceChainDataPtr for attaching the chain of = images + * starting at @top via -blockdev. + */ +qemuBlockStorageSourceChainDataPtr +qemuBuildStorageSourceChainAttachPrepareBlockdev(virStorageSourcePtr top, + virQEMUCapsPtr qemuCaps) +{ + return qemuBuildStorageSourceChainAttachPrepareBlockdevInternal(top, q= emuCaps, + false); +} + + +/** + * qemuBuildStorageSourceChainAttachPrepareBlockdevTop: + * @top: storage source chain + * @qemuCaps: qemu capabilities object + * + * Prepares qemuBlockStorageSourceChainDataPtr for attaching of @top image= only + * via -blockdev. + */ +qemuBlockStorageSourceChainDataPtr +qemuBuildStorageSourceChainAttachPrepareBlockdevTop(virStorageSourcePtr to= p, + virQEMUCapsPtr qemuCap= s) +{ + return qemuBuildStorageSourceChainAttachPrepareBlockdevInternal(top, q= emuCaps, + true); +} diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index 8695832c16..7e2dc5a60a 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -117,6 +117,9 @@ qemuBlockStorageSourceChainDataPtr qemuBuildStorageSourceChainAttachPrepareBlockdev(virStorageSourcePtr top, virQEMUCapsPtr qemuCaps); +qemuBlockStorageSourceChainDataPtr +qemuBuildStorageSourceChainAttachPrepareBlockdevTop(virStorageSourcePtr to= p, + virQEMUCapsPtr qemuCap= s); char *qemuBuildDiskDeviceStr(const virDomainDef *def, --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 16:01:09 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563883756; cv=none; d=zoho.com; s=zohoarc; b=b/D18qCg18SKqhMB8gXqz+7mYZdT8/auXT0ACJJu2IMDTaRCWAYpAGVnq/99zwtN7c3ZMiwZXahSs3FENg5fINYplin2hXM8INW3m+4WA44vrWdq5OXkRHgUjPCP5WQqotnjiifEQHH4RwUuJAbetFgosPKQfVdNFroXI9ulvfw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563883756; 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=4c8YY72UARz87JJkTMpaeCUrwolygAE+l4N+4xQ8wpc=; b=RWCFnE351XGotA3fWvQpeTzZ/+9LfTpFGCGkNzHVjBcaczrqah/QRfsYu/y9L6+9JwC+wIKgF/aBq0P5iB7Y3GrElgk+BFKJTDjJMu5731xqYAVuy32Fx+p9zovSSDIlac7bdp71P4akPZztTjqhTkj1fBLcjdO4mTGR7qbGl9M= 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 156388375634661.05963367447873; Tue, 23 Jul 2019 05:09:16 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A7911308A9E2; Tue, 23 Jul 2019 12:09:14 +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 845BE1001B35; Tue, 23 Jul 2019 12:09:14 +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 476C719736; Tue, 23 Jul 2019 12:09:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6NC8vN2009421 for ; Tue, 23 Jul 2019 08:08:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7E48E5B684; Tue, 23 Jul 2019 12:08:57 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 09A665D704 for ; Tue, 23 Jul 2019 12:08:56 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 23 Jul 2019 14:08:47 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/7] qemu: block: Add helper for generating snapshot transaction for -blockdev 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 23 Jul 2019 12:09:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" For the modern use cases we are going to use 'blockdev-snapshot' instead of 'blockdev-snapshot-sync'. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 15 +++++++++++++++ src/qemu/qemu_block.h | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 7145a2a99d..e47bc2d8f0 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1886,6 +1886,21 @@ qemuBlockSnapshotAddLegacy(virJSONValuePtr actions, } +int +qemuBlockSnapshotAddBlockdev(virJSONValuePtr actions, + virDomainDiskDefPtr disk, + virStorageSourcePtr newsrc) +{ + if (qemuMonitorJSONTransactionAdd(actions, "blockdev-snapshot", + "s:node", disk->src->nodeformat, + "s:overlay", newsrc->nodeformat, + NULL) < 0) + return -1; + + return 0; +} + + /** * qemuBlockStorageGetCopyOnReadProps: * @disk: disk with copy-on-read enabled diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h index a5f6a3c75b..5fe5319ab9 100644 --- a/src/qemu/qemu_block.h +++ b/src/qemu/qemu_block.h @@ -163,6 +163,11 @@ qemuBlockSnapshotAddLegacy(virJSONValuePtr actions, virStorageSourcePtr newsrc, bool reuse); +int +qemuBlockSnapshotAddBlockdev(virJSONValuePtr actions, + virDomainDiskDefPtr disk, + virStorageSourcePtr newsrc); + int qemuBlockStorageSourceCreateGetFormatProps(virStorageSourcePtr src, virStorageSourcePtr backing, --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 16:01:09 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563883744; cv=none; d=zoho.com; s=zohoarc; b=grawqFPZfhomBW9LIpL7RqHON9ZaZuYVqMk+8QMf+wLfkIsNzKxTHGAf6vwvP4y9/ZVgIfI3qKWaRXS/WbABHvkrov2Fl1S+uM0QzmTpkAMfbSIPBY+P7aJ9+T8Ffbw602PnJRNiMrse86RSIyH5slyNrjOOFrus01qwJN/t+5A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563883744; 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=ApEVF7phGjTk5U+Lw+Mc+Bd2w/+kziDnfvv5+NOpL/8=; b=CiXDNqLiQ0qVYEyB5rA8kjp+mVIgse2VTxN+6JAFPeKHMYmLSyJVUDhixfdJpLbnnJlYzFLkSmZ4YbTRGfmCicD54JPwZMNRbnOLX1mDZnbU/TXRY1QsCXhx7A2/r+yXkQAPfAUf0DijT35LKVY0AqhQAg2kyh2JCefgrJUEgE4= 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 1563883744386758.9986053945524; Tue, 23 Jul 2019 05:09:04 -0700 (PDT) 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 256BD83F51; Tue, 23 Jul 2019 12:09:02 +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 9FE5D5B684; Tue, 23 Jul 2019 12:09: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 29566264C9; Tue, 23 Jul 2019 12:09:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6NC8wqp009429 for ; Tue, 23 Jul 2019 08:08:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id 49E665D704; Tue, 23 Jul 2019 12:08:58 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id C95A45B684 for ; Tue, 23 Jul 2019 12:08:57 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 23 Jul 2019 14:08:48 +0200 Message-Id: <4622e99ea6c1c6cb86dd1b51948f02a0e4bfffa9.1563883655.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/7] qemu: Use virStorageSourceIsEmpty in qemuDomainBlockCommit 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 23 Jul 2019 12:09:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The block commit API checked 'disk->src->path' to see whether there is a reasonable disk source to be committed. As the top image can be e.g. backed by NBD the check is not good enough. Replace it by virStorageSourceIsEmpty. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 482f915b67..042efae49f 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17949,7 +17949,7 @@ qemuDomainBlockCommit(virDomainPtr dom, if (!(device =3D qemuAliasDiskDriveFromDisk(disk))) goto endjob; - if (!disk->src->path) { + if (virStorageSourceIsEmpty(disk->src)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("disk %s has no source file to be committed"), disk->dst); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 16:01:09 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563883744; cv=none; d=zoho.com; s=zohoarc; b=d61+g/fvTSVE53VPghsCnmNM7qBe4atXjyYyDKpYD7ZzqN29qOoUvuz3mw/7ZH9jjAIsQwe1yZb+bO7swIroVTQbiM2XLJ+5af6l6T6sHNpK9OYYG/kGvx3JRvmcFVd5zAn5IhhEtxnQ9VdT3579ItCPb9WGMykb1XdUOJveWuc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563883744; 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=OH45fLKZyB53HRtn5AYlWJwY3DocRe8xQ6XRkiXIUsk=; b=hrRO1KBGg5ZcQjF+i/ncYjexwDvl7SXMIkQ2rMzQatd5d1R5x2m/MDRY5uO3h5FdstzJTm/xujR2g8ZS+K7llifEl6OPUqOHsLIlNrqwMDvcACs5QrJTLTAnqQJ3SuY0xTMC5dvhJa0nC3XvFtgeKPmI/cdwVgBzkaFMce3gG4I= 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 1563883744183176.02845022601787; Tue, 23 Jul 2019 05:09:04 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D2170C18B2D2; Tue, 23 Jul 2019 12:09:02 +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 986C760852; Tue, 23 Jul 2019 12:09:02 +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 2D5741800207; Tue, 23 Jul 2019 12:09:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6NC8xxd009436 for ; Tue, 23 Jul 2019 08:08:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1768B5D704; Tue, 23 Jul 2019 12:08:59 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 94B105B684 for ; Tue, 23 Jul 2019 12:08:58 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 23 Jul 2019 14:08:49 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/7] qemu: block: Use simple backing stores string format if possible 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 23 Jul 2019 12:09:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" In case when the backing store can be represented with something simpler such as an URI we can use it rather than falling back to the json: pseudo-protocol. In cases when it's not worth it (e.g. with the old ugly NBD or RBD strings let's switch to json). The function is exported as we'll need it when overwriting the ugly strings qemu would come up with during blockjobs. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 93 ++++++++++++++----- src/qemu/qemu_block.h | 4 + .../imagecreate/qcow2-backing-raw-nbd.json | 2 +- 3 files changed, 76 insertions(+), 23 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index e47bc2d8f0..47661fb8bd 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1923,15 +1923,80 @@ qemuBlockStorageGetCopyOnReadProps(virDomainDiskDef= Ptr disk) } +/** + * qemuBlockGetBackingStoreString: + * @src: storage source to get the string for + * + * Formats a string used in the backing store field of a disk image which + * supports backing store. Non-local storage may result in use of the json: + * pseudo protocol for any complex configuration. + */ +char * +qemuBlockGetBackingStoreString(virStorageSourcePtr src) +{ + int actualType =3D virStorageSourceGetActualType(src); + VIR_AUTOPTR(virJSONValue) backingProps =3D NULL; + VIR_AUTOPTR(virURI) uri =3D NULL; + VIR_AUTOFREE(char *) backingJSON =3D NULL; + char *ret =3D NULL; + + if (virStorageSourceIsLocalStorage(src)) { + ignore_value(VIR_STRDUP(ret, src->path)); + return ret; + } + + /* generate simplified URIs for the easy cases */ + if (actualType =3D=3D VIR_STORAGE_TYPE_NETWORK && + src->nhosts =3D=3D 1 && + src->hosts->transport =3D=3D VIR_STORAGE_NET_HOST_TRANS_TCP) { + + switch ((virStorageNetProtocol) src->protocol) { + case VIR_STORAGE_NET_PROTOCOL_NBD: + case VIR_STORAGE_NET_PROTOCOL_HTTP: + case VIR_STORAGE_NET_PROTOCOL_HTTPS: + case VIR_STORAGE_NET_PROTOCOL_FTP: + case VIR_STORAGE_NET_PROTOCOL_FTPS: + case VIR_STORAGE_NET_PROTOCOL_TFTP: + case VIR_STORAGE_NET_PROTOCOL_ISCSI: + case VIR_STORAGE_NET_PROTOCOL_GLUSTER: + if (!(uri =3D qemuBlockStorageSourceGetURI(src))) + return NULL; + + if (!(ret =3D virURIFormat(uri))) + return NULL; + + return ret; + + case VIR_STORAGE_NET_PROTOCOL_SHEEPDOG: + case VIR_STORAGE_NET_PROTOCOL_RBD: + case VIR_STORAGE_NET_PROTOCOL_VXHS: + case VIR_STORAGE_NET_PROTOCOL_SSH: + case VIR_STORAGE_NET_PROTOCOL_LAST: + case VIR_STORAGE_NET_PROTOCOL_NONE: + break; + } + } + + /* use json: pseudo protocol otherwise */ + if (!(backingProps =3D qemuBlockStorageSourceGetBackendProps(src, fals= e, true, false))) + return NULL; + + if (!(backingJSON =3D virJSONValueToString(backingProps, false))) + return NULL; + + if (virAsprintf(&ret, "json:%s", backingJSON) < 0) + return NULL; + + return ret; +} + + static int qemuBlockStorageSourceCreateAddBacking(virStorageSourcePtr backing, virJSONValuePtr props, bool format) { - VIR_AUTOPTR(virJSONValue) backingProps =3D NULL; - VIR_AUTOFREE(char *) backingJSON =3D NULL; - VIR_AUTOFREE(char *) backingPseudoprotocol =3D NULL; - const char *backingFileStr =3D NULL; + VIR_AUTOFREE(char *) backingFileStr =3D NULL; const char *backingFormatStr =3D NULL; if (!virStorageSourceIsBacking(backing)) @@ -1945,24 +2010,8 @@ qemuBlockStorageSourceCreateAddBacking(virStorageSou= rcePtr backing, backingFormatStr =3D virStorageFileFormatTypeToString(backing-= >format); } - if (virStorageSourceIsLocalStorage(backing)) { - backingFileStr =3D backing->path; - } else { - if (!(backingProps =3D qemuBlockStorageSourceGetBackendProps(backi= ng, false, - true, f= alse))) { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", - _("failed to generate backing file JSON propert= ies")); - return -1; - } - - if (!(backingJSON =3D virJSONValueToString(backingProps, false))) - return -1; - - if (virAsprintf(&backingPseudoprotocol, "json:%s", backingJSON) < = 0) - return -1; - - backingFileStr =3D backingPseudoprotocol; - } + if (!(backingFileStr =3D qemuBlockGetBackingStoreString(backing))) + return -1; if (virJSONValueObjectAdd(props, "S:backing-file", backingFileStr, diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h index 5fe5319ab9..ab6b9dc791 100644 --- a/src/qemu/qemu_block.h +++ b/src/qemu/qemu_block.h @@ -168,6 +168,10 @@ qemuBlockSnapshotAddBlockdev(virJSONValuePtr actions, virDomainDiskDefPtr disk, virStorageSourcePtr newsrc); +char * +qemuBlockGetBackingStoreString(virStorageSourcePtr src) + ATTRIBUTE_NONNULL(1); + int qemuBlockStorageSourceCreateGetFormatProps(virStorageSourcePtr src, virStorageSourcePtr backing, diff --git a/tests/qemublocktestdata/imagecreate/qcow2-backing-raw-nbd.json= b/tests/qemublocktestdata/imagecreate/qcow2-backing-raw-nbd.json index 34ce74a548..b9d1d97302 100644 --- a/tests/qemublocktestdata/imagecreate/qcow2-backing-raw-nbd.json +++ b/tests/qemublocktestdata/imagecreate/qcow2-backing-raw-nbd.json @@ -10,6 +10,6 @@ format: "driver": "qcow2", "file": "0123456789ABCDEF0123456789ABCDE", "size": 1337, - "backing-file": "json:{\"driver\":\"nbd\",\"server\":{\"type\":\"inet\",= \"host\":\"example.com\",\"port\":\"1234\"}}", + "backing-file": "nbd://example.com:1234", "backing-fmt": "raw" } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 16:01:09 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563883749; cv=none; d=zoho.com; s=zohoarc; b=DcJMCmSrmiYPUIv1x09t85Yfokf6pkY8ADVzlFYdbpk3i8ecyLCkbu5L012jAwD+GtNyerISE7l5JGDuWbL+DwIF16NPQsbRjcC6VPE9PivfNFW5iq2opOEaNOYjjI1Go9KVWx4ys7/nFBgJS7PZQoGswRQ227e7yDCyc1DXz+8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563883749; 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=4xmTPhxaPL7kASnLF+PzDyEnSkK6T+8l79YdPZy9iQA=; b=SnOPEikMxMmrkPDzYS11/1KBTVqF+hNoPwPdHGCxppeXtK7nYI+w3iZqKW9ZtaMnsfzDJNhetFJjjJiLkikwk5na7zOHEsIQ+Ywpk74XkRNj4XEncYIv5oARgnqD6bIz0RSr6sPzpbIapLwL9DhqsD56jvI9KqLHi5552rB6HNY= 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 1563883749332131.5613091964981; Tue, 23 Jul 2019 05:09:09 -0700 (PDT) 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 EDA023071D7E; Tue, 23 Jul 2019 12:09:07 +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 CAEA6173BB; Tue, 23 Jul 2019 12:09:07 +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 905C7180020B; Tue, 23 Jul 2019 12:09:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6NC8xkh009449 for ; Tue, 23 Jul 2019 08:08:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id D66525D704; Tue, 23 Jul 2019 12:08:59 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 621B95B685 for ; Tue, 23 Jul 2019 12:08:59 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 23 Jul 2019 14:08:50 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 6/7] qemu: snapshot: Initialize data for inactive config of snapshot earlier 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Tue, 23 Jul 2019 12:09:08 +0000 (UTC) Content-Type: text/plain; charset="utf-8" qemuDomainSnapshotDiskDataCollect copies the source of the disk from the live config into the inactive config. Move this operation earlier so that if we initialize it for use for the particular instance the run-time-only data is not copied. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 042efae49f..69327c148a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -15114,6 +15114,22 @@ qemuDomainSnapshotDiskDataCollect(virQEMUDriverPtr= driver, if (virStorageSourceInitChainElement(dd->src, dd->disk->src, false= ) < 0) goto cleanup; + /* Note that it's unsafe to assume that the disks in the persistent + * definition match up with the disks in the live definition just = by + * checking that the target name is the same. We've done that + * historically this way though. */ + if (vm->newDef && + (dd->persistdisk =3D virDomainDiskByName(vm->newDef, dd->disk-= >dst, + false))) { + + if (!(dd->persistsrc =3D virStorageSourceCopy(dd->src, false))) + goto cleanup; + + if (virStorageSourceInitChainElement(dd->persistsrc, + dd->persistdisk->src, fal= se) < 0) + goto cleanup; + } + if (qemuDomainStorageFileInit(driver, vm, dd->src, NULL) < 0) goto cleanup; @@ -15131,22 +15147,6 @@ qemuDomainSnapshotDiskDataCollect(virQEMUDriverPtr= driver, VIR_FREE(backingStoreStr); } } - - /* Note that it's unsafe to assume that the disks in the persistent - * definition match up with the disks in the live definition just = by - * checking that the target name is the same. We've done that - * historically this way though. */ - if (vm->newDef && - (dd->persistdisk =3D virDomainDiskByName(vm->newDef, dd->disk-= >dst, - false))) { - - if (!(dd->persistsrc =3D virStorageSourceCopy(dd->src, false))) - goto cleanup; - - if (virStorageSourceInitChainElement(dd->persistsrc, - dd->persistdisk->src, fal= se) < 0) - goto cleanup; - } } VIR_STEAL_PTR(*rdata, data); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 16:01:09 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563883752; cv=none; d=zoho.com; s=zohoarc; b=BtPEKgav6Xmj/sBbKi27Sx2Ubr3h84IS7LGm6b4S10BJ/XcjDdt32L3iYnMFTbUohzC6gF8au1415DEUEn3icXjndjYGF5su57GfUcn6LayteiLcx9rxbgGJOhnyghCMX0d3EcRWnoW5EbEQfvk77xC9X41QRMT35Mb3hkQWUl0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563883752; 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=xWL5Jxdh2ADkv4wbPGOSykOIyZ+6zAQu9qdx7x+ZbEo=; b=kD1mi6di0UjOst2ZGYKFf4TnWUhq7QoY04U+BIQ+2xPdxlS9Hzhg7XbPwSRnRRpidK++GDLTnQbYjh66qcKbNUT3CDp9JxpcolE1y4Lshwt01BO+3wyVqqsRJpQQfCVGASswaRmNbVSt5MVJEdK38RoJnfZQ1jzvSB3xdMX0R6U= 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 1563883752642485.94285542643604; Tue, 23 Jul 2019 05:09:12 -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 2E58585539; Tue, 23 Jul 2019 12:09:11 +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 027B360BF7; Tue, 23 Jul 2019 12:09:11 +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 AC490180020F; Tue, 23 Jul 2019 12:09:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6NC90De009459 for ; Tue, 23 Jul 2019 08:09:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id A3FF45B687; Tue, 23 Jul 2019 12:09:00 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2D4C75D704 for ; Tue, 23 Jul 2019 12:09:00 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 23 Jul 2019 14:08:51 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 7/7] qemu: blockjob: Reset 'synchronous' block job handling flag prior to flushing events 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.28]); Tue, 23 Jul 2019 12:09:11 +0000 (UTC) Content-Type: text/plain; charset="utf-8" When returning to asynchronous block job handling the flag which determines the handling method should be reset prior to flushing outstanding events. If there's an event to process the handler may invoke the monitor and another event may be received. We'd not process that one. Reset the flag earlier. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_blockjob.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 292610d089..dfa55a0e7a 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -808,8 +808,8 @@ qemuBlockJobSyncEnd(virDomainObjPtr vm, diskdst =3D job->disk->dst; VIR_DEBUG("disk=3D%s", NULLSTR(diskdst)); - qemuBlockJobUpdate(vm, job, asyncJob); job->synchronous =3D false; + qemuBlockJobUpdate(vm, job, asyncJob); } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list