[PATCH qemu-server v3 02/18] qmp client: add default timeouts for more block commands

Fiona Ebner
2026-04-23T09:39:17Z

Based on pre-existing defaults for similar commands, commands for
adding get 1 minute, commands for creating block jobs or removing get
10 minutes, since those might require in-flight IO to finish.

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

diff --git a/src/PVE/QMPClient.pm b/src/PVE/QMPClient.pm
index 723123a6..4d4a2f82 100644
--- a/src/PVE/QMPClient.pm
+++ b/src/PVE/QMPClient.pm
@@ -120,6 +120,8 @@ sub cmd {
$timeout = 3 * 60;
} elsif (
$cmd->{execute} eq 'blockdev-add'
+ || $cmd->{execute} eq 'blockdev-insert-medium'
+ || $cmd->{execute} eq 'block-export-add'
|| $cmd->{execute} eq 'device_add'
|| $cmd->{execute} eq 'device_del'
|| $cmd->{execute} eq 'netdev_add'
@@ -130,8 +132,13 @@ sub cmd {
$timeout = 60;
} elsif (
$cmd->{execute} eq 'backup-cancel'
+ || $cmd->{execute} eq 'block-commit'
+ || $cmd->{execute} eq 'block-export-del'
+ || $cmd->{execute} eq 'block-stream'
|| $cmd->{execute} eq 'blockdev-del'
|| $cmd->{execute} eq 'blockdev-mirror'
+ || $cmd->{execute} eq 'blockdev-remove-medium'
+ || $cmd->{execute} eq 'blockdev-reopen'
|| $cmd->{execute} eq 'block-job-cancel'
|| $cmd->{execute} eq 'job-complete'
|| $cmd->{execute} eq 'drive-mirror'
--
2.47.3