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: [pve-devel] [PATCH qemu-server 1/2] qmp: verify device deletion: allow specifying timeout
Date: Tue, 22 Jul 2025 11:30:33 +0200	[thread overview]
Message-ID: <20250722093238.24988-1-f.ebner@proxmox.com> (raw)

The default timeout is not appropriate in all cases, e.g. removing a
VirtIO SCSI controller can take more than 5 seconds.

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

diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index d7398648..9f327955 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -4126,12 +4126,14 @@ sub qemu_deviceaddverify {
 }
 
 sub qemu_devicedelverify {
-    my ($vmid, $deviceid) = @_;
+    my ($vmid, $deviceid, $timeout) = @_;
+
+    $timeout //= 5;
 
     # need to verify that the device is correctly removed as device_del
     # is async and empty return is not reliable
 
-    for (my $i = 0; $i <= 5; $i++) {
+    for (my $i = 0; $i <= $timeout; $i++) {
         my $devices_list = vm_devices_list($vmid);
         return 1 if !defined($devices_list->{$deviceid});
         sleep 1;
-- 
2.47.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


             reply	other threads:[~2025-07-22  9:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-22  9:30 Fiona Ebner [this message]
2025-07-22  9:30 ` [pve-devel] [PATCH qemu-server 2/2] qmp: device unplug: bump timeout for removing virtio scsi controller Fiona Ebner
2025-07-25 12:15 ` [pve-devel] applied-series: [PATCH qemu-server 1/2] qmp: verify device deletion: allow specifying timeout Fabian Grünbichler

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=20250722093238.24988-1-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