From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 6360C1FF0E6 for ; Fri, 24 Jul 2026 16:32:53 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 4AEDD21552; Fri, 24 Jul 2026 16:32:49 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Subject: [PATCH-SERIES qemu/qemu-server 0/9] mirror: fix regressions with blockdev and allow migration with 'ro' flag Date: Fri, 24 Jul 2026 16:32:21 +0200 Message-ID: <20260724143240.211130-1-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1784903533189 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.210 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: 5JYWPUC34PJGCHWRCNEM3JKRTTOEC6BH X-Message-ID-Hash: 5JYWPUC34PJGCHWRCNEM3JKRTTOEC6BH X-MailFrom: f.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; 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: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: fix #7299: Since the switch to -blockdev was made in Proxmox VE 9, the root block node is now always a throttle node for optionally limiting the guest IO. Mirror jobs are accidentally affected by a set limit too, because the throttle root block node was passed as the source of the mirror job. Fix this by allowing non-root nodes to be used for the mirror job and passing along the node below throttle instead. Unfortunately, my upstream submission for QEMU [0] has not received a reply yet, and thus won't land in QEMU 11.1. Pick it up downstream for now. [0]: https://lore.kernel.org/qemu-devel/20260611102247.622275-1-f.ebner@proxmox.com/ fix #7836: The switch to -blockdev in Proxmox VE 9 introduced a regression, making clone of a VM with a read-only drive fail. The reason is that the target node is also attached as read-only and thus cannot serve as the mirror target. To fix the issue, open the mirror target as writeable initially and in case the VM switched to the new drive, re-open as read-only later. Note that the drive device is always read-only for the guest, because the top throttle node is. For migration, there is a similar issue, since a drive with read-only cannot serve as a writeable block export for the NBD mirror target. This is not a regression and was always broken, but can be resolved for -blockdev by re-opening the node below throttle as writeable, exporting it, and then re-opening it as read-only after finishing the migration. Not sure if applying the read-only flags to the nodes below throttle is fully worth it. It does add some work and complexity, but for the guest only the read-write status of the throttle node would actually matter. NOTE: The QEMU binary version in qemu-server patch "partially fix #7299: fix regression with guest IO limits applying to mirror job" in the runs_at_least_qemu_version() check needs to be adapted when applying, to the pve-qemu version which actually does allow non-root nodes as a mirror source. pve-qemu: Fiona Ebner (1): add patch to allow mirror job to use non-root block node ...d-support-for-sync-bitmap-mode-never.patch | 8 +-- ...check-for-bitmap-mode-without-bitmap.patch | 2 +- .../0006-mirror-move-some-checks-to-qmp.patch | 2 +- ...ror-do-not-require-a-root-block-node.patch | 68 +++++++++++++++++++ ...ckup-Proxmox-backup-patches-for-QEMU.patch | 2 +- debian/patches/series | 1 + 6 files changed, 76 insertions(+), 7 deletions(-) create mode 100644 debian/patches/extra/0053-blockdev-mirror-do-not-require-a-root-block-node.patch qemu-server: Fiona Ebner (8): partially fix #7299: fix regression with guest IO limits applying to mirror job partially fix #7299: migrate: fix regression with guest IO limits applying to NBD export blockdev: attach: support explicitly attaching as writeable blockdev: implement reopen function partially fix #7836: allow mirror for drive with read-only flag when using blockdev qm: schema: declare 'nbdstop' command as being for internal use only migrate: log messages from remote nbdstop command partially fix #7836: allow migration for drive with read-only flag when using blockdev src/PVE/API2/Qemu.pm | 7 +- src/PVE/CLI/qm.pm | 32 +++++++- src/PVE/QemuMigrate.pm | 15 +++- src/PVE/QemuServer.pm | 22 +++++- src/PVE/QemuServer/BlockJob.pm | 120 ++++++++++++++++++++++++++++- src/PVE/QemuServer/Blockdev.pm | 76 ++++++++++++++---- src/test/MigrationTest/QmMock.pm | 7 -- src/test/MigrationTest/Shared.pm | 35 +++++++++ src/test/run_qemu_migrate_tests.pl | 8 +- 9 files changed, 284 insertions(+), 38 deletions(-) Summary over all repositories: 15 files changed, 360 insertions(+), 45 deletions(-) -- Generated by git-murpp 0.5.0