all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH qemu-server v2 1/3] blockdev: commit: improve comment about completion mode
Date: Thu, 12 Feb 2026 16:36:22 +0100	[thread overview]
Message-ID: <20260212153638.476233-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20260212153638.476233-1-f.ebner@proxmox.com>

For reference, see the QMP docs [0][1].

[0]: https://qemu.readthedocs.io/en/master/interop/qemu-qmp-ref.html#command-QMP-block-core.block-commit
[1]: https://qemu.readthedocs.io/en/master/interop/qemu-qmp-ref.html#command-QMP-job.job-complete

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/QemuServer/Blockdev.pm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/PVE/QemuServer/Blockdev.pm b/src/PVE/QemuServer/Blockdev.pm
index af7e769b..8eb01b45 100644
--- a/src/PVE/QemuServer/Blockdev.pm
+++ b/src/PVE/QemuServer/Blockdev.pm
@@ -1074,7 +1074,15 @@ sub blockdev_commit {
         mon_cmd($vmid, "block-commit", %$opts);
         $jobs->{$job_id} = {};
 
-        # if we commit the current, the blockjob need to be in 'complete' mode
+        # If the 'current' state is committed to its backing snapshot, the job will not complete
+        # automatically, because there is a writer, i.e. the guest. It is necessary to use the
+        # 'complete' completion mode, so that the 'current' block node is replaced with the backing
+        # node upon completion. Like that, IO after the commit operation will already land in the
+        # backing node, which will be renamed since it will be the new top of the chain (done by the
+        # caller).
+        #
+        # For other snapshots in the chain, it can be assumed that they have no writer, so
+        # 'block-commit' will complete automatically.
         my $complete = $src_snap && $src_snap ne 'current' ? 'auto' : 'complete';
 
         eval {
-- 
2.47.3





  reply	other threads:[~2026-02-12 15:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-12 15:36 [PATCH-SERIES qemu-server v2 0/3] small block job related improvements Fiona Ebner
2026-02-12 15:36 ` Fiona Ebner [this message]
2026-02-12 15:36 ` [PATCH qemu-server v2 2/3] block job: rename qemu_drive_mirror_monitor() to monitor() Fiona Ebner
2026-02-12 15:36 ` [PATCH qemu-server v2 3/3] blockdev: avoid potentially misleading error messages when block job monitor fails Fiona Ebner
2026-02-13 16:55 ` superseded: [PATCH-SERIES qemu-server v2 0/3] small block job related improvements Fiona Ebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260212153638.476233-2-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal