all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH-SERIES qemu-server v2 0/4] fix #8371: bump timeout for more block QMP commands
@ 2026-11-30 10:54 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
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Fiona Ebner @ 2026-11-30 10:54 UTC (permalink / raw)
  To: pve-devel

Changes in v2:
* Also bump timeout for block_resize.
* Also bump timeout for query-named-block-nodes.

The 'query-block' and 'query-named-block-nodes' QMP commands 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. There are a few cases,
where the command is reached during a short-lived hotplug or
hotunplug, so preserve the timeout of 5 seconds for those.

Also bump the timeout of 'block_resize' further, for consistency with
other block operations.

qemu-server:

Fiona Ebner (4):
  blockdev: resize: bump timeout for resize QMP command to 10 minutes
  fix #8371: qmp client: bump timeout for query-block for long-running
    operations
  blockdev: detach: allow specifying custom timeout
  qmp client: bump timeout for query-named-block-nodes for long-running
    operations

 src/PVE/QMPClient.pm           | 3 +++
 src/PVE/QemuServer.pm          | 4 ++--
 src/PVE/QemuServer/Blockdev.pm | 8 +++++---
 3 files changed, 10 insertions(+), 5 deletions(-)


Summary over all repositories:
  3 files changed, 10 insertions(+), 5 deletions(-)

-- 
Generated by git-murpp 0.5.0




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH qemu-server v2 1/4] blockdev: resize: bump timeout for resize QMP command to 10 minutes
  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 ` Fiona Ebner
  2026-11-30 10:54 ` [PATCH qemu-server v2 2/4] fix #8371: qmp client: bump timeout for query-block for long-running operations Fiona Ebner
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Fiona Ebner @ 2026-11-30 10:54 UTC (permalink / raw)
  To: pve-devel

Most other block commands doing IO have a 10 minute timeout, so
align the timeout for 'block_resize' to that as well for consistency.

Commit 190c8461 ("increase timeout for QMP block_resize") already
increased it to a minute, but there does not seem to be a good reason
to require a shorter timeout than other block operations.

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

diff --git a/src/PVE/QMPClient.pm b/src/PVE/QMPClient.pm
index 607aec6b..c91b6796 100644
--- a/src/PVE/QMPClient.pm
+++ b/src/PVE/QMPClient.pm
@@ -146,6 +146,7 @@ sub cmd {
             $cmd->{execute} eq 'backup-cancel'
             || $cmd->{execute} eq 'block-commit'
             || $cmd->{execute} eq 'block-export-del'
+            || $cmd->{execute} eq 'block_resize'
             || $cmd->{execute} eq 'block-stream'
             || $cmd->{execute} eq 'blockdev-del'
             || $cmd->{execute} eq 'blockdev-mirror'
diff --git a/src/PVE/QemuServer/Blockdev.pm b/src/PVE/QemuServer/Blockdev.pm
index c2989a37..806a08aa 100644
--- a/src/PVE/QemuServer/Blockdev.pm
+++ b/src/PVE/QemuServer/Blockdev.pm
@@ -750,7 +750,6 @@ sub resize {
         # -drive, there is no top throttle node, so this also is the correct node.
         'node-name' => "$inserted->{'node-name'}",
         size => int($size),
-        timeout => 60,
     );
 }
 
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH qemu-server v2 2/4] fix #8371: qmp client: bump timeout for query-block for long-running operations
  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
  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
  3 siblings, 0 replies; 5+ messages in thread
From: Fiona Ebner @ 2026-11-30 10:54 UTC (permalink / raw)
  To: pve-devel

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





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH qemu-server v2 3/4] blockdev: detach: allow specifying custom timeout
  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 ` [PATCH qemu-server v2 2/4] fix #8371: qmp client: bump timeout for query-block for long-running operations Fiona Ebner
@ 2026-11-30 10:54 ` 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
  3 siblings, 0 replies; 5+ messages in thread
From: Fiona Ebner @ 2026-11-30 10:54 UTC (permalink / raw)
  To: pve-devel

For long-running operations, the timeout for query-named-block-nodes
will be bumped, so the hotunplug caller needs a way to preserve the
current shorter timeout.

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

diff --git a/src/PVE/QemuServer/Blockdev.pm b/src/PVE/QemuServer/Blockdev.pm
index 806a08aa..9aac912d 100644
--- a/src/PVE/QemuServer/Blockdev.pm
+++ b/src/PVE/QemuServer/Blockdev.pm
@@ -656,6 +656,8 @@ Parameters:
 
 =item C<'follow-backing'>: also detach the 'backing' children.
 
+=item C<'query-timeout'>: Timeout used for the initial query operation.
+
 =back
 
 =back
@@ -669,7 +671,8 @@ sub detach {
 
     my $follow_backing = $opts->{'follow-backing'};
 
-    my $block_info = qmp_cmd($qmp_peer, "query-named-block-nodes");
+    my $block_info =
+        qmp_cmd($qmp_peer, "query-named-block-nodes", timeout => $opts->{'query-timeout'});
     $block_info = { map { $_->{'node-name'} => $_ } $block_info->@* };
 
     my $remove_throttle_group_id;
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH qemu-server v2 4/4] qmp client: bump timeout for query-named-block-nodes for long-running operations
  2026-11-30 10:54 [PATCH-SERIES qemu-server v2 0/4] fix #8371: bump timeout for more block QMP commands Fiona Ebner
                   ` (2 preceding siblings ...)
  2026-11-30 10:54 ` [PATCH qemu-server v2 3/4] blockdev: detach: allow specifying custom timeout Fiona Ebner
@ 2026-11-30 10:54 ` Fiona Ebner
  3 siblings, 0 replies; 5+ messages in thread
From: Fiona Ebner @ 2026-11-30 10:54 UTC (permalink / raw)
  To: pve-devel

Following patch "fix #8371: qmp client: bump timeout for query-block
for long-running operations", now for 'query-named-block-nodes'.

The same reasoning applies. The 'query-named-block-nodes' 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,
commit, stream, VM destroy, etc. which are all long-running
operations. The two exceptions are qemu_drivedel() and
blockdev_change_medium(), which are called during short-running
hotunplug/medium change operations, so preserve the timeout of 5
seconds for those.

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

diff --git a/src/PVE/QMPClient.pm b/src/PVE/QMPClient.pm
index 9c1429c9..6d31bd5f 100644
--- a/src/PVE/QMPClient.pm
+++ b/src/PVE/QMPClient.pm
@@ -160,6 +160,7 @@ sub cmd {
             || $cmd->{execute} eq 'query-backup'
             || $cmd->{execute} eq 'query-block'
             || $cmd->{execute} eq 'query-block-jobs'
+            || $cmd->{execute} eq 'query-named-block-nodes'
             || $cmd->{execute} eq 'query-savevm'
             || $cmd->{execute} eq 'savevm-end'
             || $cmd->{execute} eq 'savevm-start'
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 3c4cbcc9..d7ba41f7 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -4106,7 +4106,7 @@ sub qemu_drivedel {
         PVE::QemuServer::Blockdev::detach(
             vm_qmp_peer($vmid),
             "drive-$deviceid",
-            { 'follow-backing' => 1 },
+            { 'follow-backing' => 1, 'query-timeout' => 5 },
         );
         return 1;
     } else {
diff --git a/src/PVE/QemuServer/Blockdev.pm b/src/PVE/QemuServer/Blockdev.pm
index 9aac912d..363796cb 100644
--- a/src/PVE/QemuServer/Blockdev.pm
+++ b/src/PVE/QemuServer/Blockdev.pm
@@ -762,7 +762,7 @@ my sub blockdev_change_medium {
     # force eject if locked
     mon_cmd($vmid, "blockdev-open-tray", force => JSON::true, id => "$qdev_id");
     mon_cmd($vmid, "blockdev-remove-medium", id => "$qdev_id");
-    detach(vm_qmp_peer($vmid), "drive-$qdev_id");
+    detach(vm_qmp_peer($vmid), "drive-$qdev_id", { 'query-timeout' => 5 });
 
     return if $drive->{file} eq 'none';
 
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-30 10:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH qemu-server v2 2/4] fix #8371: qmp client: bump timeout for query-block for long-running operations Fiona Ebner
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

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