mirror of
				https://git.proxmox.com/git/qemu-server
				synced 2025-10-31 08:36:50 +00:00 
			
		
		
		
	fix #5440: hmp helpers: drive{add, del}: increase timeout
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 <f.ebner@proxmox.com>
This commit is contained in:
		
							parent
							
								
									990e32ff1b
								
							
						
					
					
						commit
						daf64a27b9
					
				| @ -4380,7 +4380,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; | ||||
| @ -4391,7 +4391,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 ""; | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Fiona Ebner
						Fiona Ebner