From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id AC1F01FF38D for ; Fri, 3 May 2024 13:20:21 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id C125036763; Fri, 3 May 2024 13:20:04 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Fri, 3 May 2024 13:19:54 +0200 Message-Id: <20240503111956.46543-6-f.ebner@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240503111956.46543-1-f.ebner@proxmox.com> References: <20240503111956.46543-1-f.ebner@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.065 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH qemu-server 5/5] fix #5440: hmp helpers: drive{add, del}: increase timeout X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" The default timeout for HMP commands is 5 seconds. While it should be rather fast to attach a new drive to QEMU, a busy system might take longer, so future-proof and increase to 60 seconds. On the other hand, detaching a drive needs to complete any pending IO on it, so use the same 10 minutes timeout that's used for drive-related QMP commands. Signed-off-by: Fiona Ebner --- PVE/QemuServer.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 82e7d6a6..ba3d9f26 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -4377,7 +4377,7 @@ sub qemu_driveadd { my $io_uring = min_version($kvmver, 6, 0); my $drive = print_drive_commandline_full($storecfg, $vmid, $device, undef, $io_uring); $drive =~ s/\\/\\\\/g; - my $ret = PVE::QemuServer::Monitor::hmp_cmd($vmid, "drive_add auto \"$drive\""); + my $ret = PVE::QemuServer::Monitor::hmp_cmd($vmid, "drive_add auto \"$drive\"", 60); # If the command succeeds qemu prints: "OK" return 1 if $ret =~ m/OK/s; @@ -4388,7 +4388,7 @@ sub qemu_driveadd { sub qemu_drivedel { my ($vmid, $deviceid) = @_; - my $ret = PVE::QemuServer::Monitor::hmp_cmd($vmid, "drive_del drive-$deviceid"); + my $ret = PVE::QemuServer::Monitor::hmp_cmd($vmid, "drive_del drive-$deviceid", 10 * 60); $ret =~ s/^\s+//; return 1 if $ret eq ""; -- 2.39.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel