public inbox for pve-devel@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 2/4] fix #8371: qmp client: bump timeout for query-block for long-running operations
Date: Mon, 30 Nov 2026 11:54:15 +0100	[thread overview]
Message-ID: <20261130105428.49588-3-f.ebner@proxmox.com> (raw)
In-Reply-To: <20261130105428.49588-1-f.ebner@proxmox.com>

The 'query-block' QMP command can do IO on the underlying storage, for
example via .bdrv_co_get_allocated_file_size(), so can take some time.
Use the same timeout as for other block operations. The command is
reached during blockdev_replace(), live import/restore, backup, drive
mirror, setting up NBD exports on the migration target, as well as
block resize, which are all long-running operations. The only
exception is vm_devices_list(), which is called during a short-running
hotplug operation, so preserve the timeout of 5 seconds for that.

In #8371, during a Blockdev::resize(), the storage layer resized the
underlying LV, but then the 'query-block' QMP command timed out.
Moving the 'query-block' QMP command to before
Storage::volume_resize() would not fully prevent the situation either,
because the 'block_resize' QMP command could time out when connecting
to the socket. Keep the query and modify QMP commands close together
since they can be considered belonging to the same part of the
operation, namely the part interacting with QEMU.

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

diff --git a/src/PVE/QMPClient.pm b/src/PVE/QMPClient.pm
index c91b6796..9c1429c9 100644
--- a/src/PVE/QMPClient.pm
+++ b/src/PVE/QMPClient.pm
@@ -158,6 +158,7 @@ sub cmd {
             || $cmd->{execute} eq 'guest-fstrim'
             || $cmd->{execute} eq 'guest-shutdown'
             || $cmd->{execute} eq 'query-backup'
+            || $cmd->{execute} eq 'query-block'
             || $cmd->{execute} eq 'query-block-jobs'
             || $cmd->{execute} eq 'query-savevm'
             || $cmd->{execute} eq 'savevm-end'
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index ecbaa27f..3c4cbcc9 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -3850,7 +3850,7 @@ sub vm_devices_list {
 
     # Block device IDs need to be checked at the qdev level, since with '-blockdev', the 'device'
     # property will not be set.
-    my $resblock = mon_cmd($vmid, 'query-block');
+    my $resblock = mon_cmd($vmid, 'query-block', timeout => 5);
     for my $block ($resblock->@*) {
         my $qdev_id = $block->{qdev} or next;
         my $drive_id = PVE::QemuServer::Blockdev::qdev_id_to_drive_id($qdev_id);
-- 
2.47.3





  parent reply	other threads:[~2026-11-30 10:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 10:54 [PATCH-SERIES qemu-server v2 0/4] fix #8371: bump timeout for more block QMP commands Fiona Ebner
2026-11-30 10:54 ` [PATCH qemu-server v2 1/4] blockdev: resize: bump timeout for resize QMP command to 10 minutes Fiona Ebner
2026-11-30 10:54 ` Fiona Ebner [this message]
2026-11-30 10:54 ` [PATCH qemu-server v2 3/4] blockdev: detach: allow specifying custom timeout Fiona Ebner
2026-11-30 10:54 ` [PATCH qemu-server v2 4/4] qmp client: bump timeout for query-named-block-nodes for long-running operations 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=20261130105428.49588-3-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal