From nobody Tue Oct 28 17:31:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1760363314; cv=none; d=zohomail.com; s=zohoarc; b=ZDDzicTrUlN1YyzkjwLWVnjzkhH8CBRq6F+rRDstEkMxI43/mL1lciKqN9uFmC6SOSi2B8OtgUfSUR4eLHUtAA1oIiAhoao4fpo61GGDbPyCibiP1TQ49vG8FXFTeLnwfgsp/0yy/WyXsSGYVKM30Kn6TgI42O/iTvn3eHvhMpo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1760363314; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=zA0jrA8WT/2YLSvSi31JSkSQs1Os9/Gq2+nFRXptWRk=; b=PnGnigaziP+bkMDJlvz6cFaaFp9r0JKEI5vK1zEFHYUV1Zkkha3NgSButl+zXFIi9soNeMPZILxFJKQJMM1H4ataX25TYB2baV8lJfO11EXVNHDpBL5J0kXoUmqweN1rn9s8s8HEX+beBMN2XOzko3jYxWvOSA5xThtA7ITs5e0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1760363314394462.9147341962048; Mon, 13 Oct 2025 06:48:34 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id E00CF44011; Mon, 13 Oct 2025 09:48:30 -0400 (EDT) Received: from [172.19.199.20] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 449D7446DA; Mon, 13 Oct 2025 09:41:51 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 196E243FC1; Mon, 13 Oct 2025 09:41:11 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 8B96643FE0 for ; Mon, 13 Oct 2025 09:41:05 -0400 (EDT) Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-315-NcyO_pggNhij1PPGlHGMgw-1; Mon, 13 Oct 2025 09:41:03 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 78235195410A for ; Mon, 13 Oct 2025 13:41:02 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.15]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C59281800578 for ; Mon, 13 Oct 2025 13:41:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1760362864; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=zA0jrA8WT/2YLSvSi31JSkSQs1Os9/Gq2+nFRXptWRk=; b=Ame9pL+Lizl9ZpumA1yIEPKc4KTmlVzZYAiUPcdaNlKB35HvYPq8nJieDo1cdoWwzclNm/ xtYqGX+n0BofO7TdehnXJwzkLk14U/RwS/4rQ4KuiPuZKIP40F1ucQRCC1hBblTYe7gICJ s888MCDJDA1e/6B3dQ9MVDez9iS9lMk= X-MC-Unique: NcyO_pggNhij1PPGlHGMgw-1 X-Mimecast-MFC-AGG-ID: NcyO_pggNhij1PPGlHGMgw_1760362862 To: devel@lists.libvirt.org Subject: [PATCH 3/7] qemu: Re-activate block nodes before storage operations Date: Mon, 13 Oct 2025 15:40:52 +0200 Message-ID: <61e2fe52cc5def00b9fcc8a45e4bb9d78f5f2fa9.1760362814.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: ZCyE3hlQ9vcXykXSQRr1HtSl7Ca5XstcneZKIiix-gk_1760362862 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: DB77NB6GHZYSRWGTGAOK55AFHECA6PAD X-Message-ID-Hash: DB77NB6GHZYSRWGTGAOK55AFHECA6PAD X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1760363314735158500 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Upcoming patches will modify how we treat inactive block nodes so that we can properly deactivate nodes for 'manual' disk snapshot mode. Re-activate the nodes before operations requiring them. This includes also query operations where we e.g. probe bitmaps. Signed-off-by: Peter Krempa --- src/qemu/qemu_backup.c | 3 +++ src/qemu/qemu_checkpoint.c | 12 ++++++++++++ src/qemu/qemu_driver.c | 9 +++++++++ src/qemu/qemu_migration.c | 3 +++ src/qemu/qemu_snapshot.c | 6 ++++++ 5 files changed, 33 insertions(+) diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index 1f43479b5e..3b4fe54854 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -823,6 +823,9 @@ qemuBackupBegin(virDomainObj *vm, if (qemuBackupBeginPrepareTLS(vm, cfg, def, &tlsProps, &tlsSecretProps= ) < 0) goto endjob; + if (qemuBlockNodesEnsureActive(vm, VIR_ASYNC_JOB_BACKUP) < 0) + goto endjob; + actions =3D virJSONValueNewArray(); /* The 'chk' checkpoint must be rolled back if the transaction command diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c index af847cf1f2..193cf9a06a 100644 --- a/src/qemu/qemu_checkpoint.c +++ b/src/qemu/qemu_checkpoint.c @@ -189,6 +189,9 @@ qemuCheckpointDiscardBitmaps(virDomainObj *vm, actions =3D virJSONValueNewArray(); + if (qemuBlockNodesEnsureActive(vm, VIR_ASYNC_JOB_NONE) < 0) + return -1; + if (!(blockNamedNodeData =3D qemuBlockGetNamedNodeData(vm, VIR_ASYNC_J= OB_NONE))) return -1; @@ -411,6 +414,9 @@ qemuCheckpointRedefineValidateBitmaps(virDomainObj *vm, if (virDomainObjCheckActive(vm) < 0) return -1; + if (qemuBlockNodesEnsureActive(vm, VIR_ASYNC_JOB_NONE) < 0) + return -1; + if (!(blockNamedNodeData =3D qemuBlockGetNamedNodeData(vm, VIR_ASYNC_J= OB_NONE))) return -1; @@ -516,6 +522,9 @@ qemuCheckpointCreate(virQEMUDriver *driver, if (qemuCheckpointCreateCommon(driver, vm, def, &actions, &chk) < 0) return NULL; + if (qemuBlockNodesEnsureActive(vm, VIR_ASYNC_JOB_NONE) < 0) + return NULL; + qemuDomainObjEnterMonitor(vm); rc =3D qemuMonitorTransaction(qemuDomainGetMonitor(vm), &actions); qemuDomainObjExitMonitor(vm); @@ -651,6 +660,9 @@ qemuCheckpointGetXMLDescUpdateSize(virDomainObj *vm, if (virDomainObjCheckActive(vm) < 0) goto endjob; + if (qemuBlockNodesEnsureActive(vm, VIR_ASYNC_JOB_NONE) < 0) + goto endjob; + if (!(nodedataMerge =3D qemuBlockGetNamedNodeData(vm, VIR_ASYNC_JOB_NO= NE))) goto endjob; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index ac72ea5cb0..3954857512 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -13820,6 +13820,9 @@ qemuDomainBlockPullCommon(virDomainObj *vm, speed <<=3D 20; } + if (qemuBlockNodesEnsureActive(vm, VIR_ASYNC_JOB_NONE) < 0) + goto endjob; + if (!(job =3D qemuBlockJobDiskNewPull(vm, disk, baseSource, flags))) goto endjob; @@ -14390,6 +14393,9 @@ qemuDomainBlockCopyCommon(virDomainObj *vm, goto endjob; } + if (qemuBlockNodesEnsureActive(vm, VIR_ASYNC_JOB_NONE) < 0) + goto endjob; + /* pre-create the image file. This is required so that libvirt can pro= perly * label the image for access by qemu */ if (!existing) { @@ -14796,6 +14802,9 @@ qemuDomainBlockCommit(virDomainPtr dom, base, disk->dst, N= ULL))) goto endjob; + if (qemuBlockNodesEnsureActive(vm, VIR_ASYNC_JOB_NONE) < 0) + goto endjob; + job =3D qemuBlockCommit(vm, disk, baseSource, topSource, top_parent, speed, VIR_ASYNC_JOB_NONE, VIR_TRISTATE_BOOL_YES, flags); diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 7d87b3073b..a11d1d8452 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2919,6 +2919,9 @@ qemuMigrationSrcBeginPhase(virQEMUDriver *driver, vm->newDef && !qemuDomainVcpuHotplugIsInOrder(vm->newDef))) cookieFlags |=3D QEMU_MIGRATION_COOKIE_CPU_HOTPLUG; + if (qemuBlockNodesEnsureActive(vm, vm->job->asyncJob) < 0) + return NULL; + return qemuMigrationSrcBeginXML(vm, xmlin, cookieout, cookieoutlen, cookieFlags, migrate_disks, flags); diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 764aafda4d..c988de37ca 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -2066,6 +2066,9 @@ qemuSnapshotCreate(virDomainObj *vm, /* actually do the snapshot */ if (virDomainObjIsActive(vm)) { + if (qemuBlockNodesEnsureActive(vm, VIR_ASYNC_JOB_SNAPSHOT) < 0) + goto error; + if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY || virDomainSnapshotObjGetDef(snap)->memory =3D=3D VIR_DOMAIN_SNA= PSHOT_LOCATION_EXTERNAL) { /* external full system or disk snapshot */ @@ -4094,6 +4097,9 @@ qemuSnapshotDiscardImpl(virDomainObj *vm, return -1; } } else { + if (qemuBlockNodesEnsureActive(vm, VIR_ASYNC_JOB_SNAPSHOT) < 0) + return -1; + if (virDomainSnapshotIsExternal(snap)) { if (qemuSnapshotDiscardExternal(vm, snap, externalData) < = 0) return -1; --=20 2.51.0