[pve-devel] [PATCH] qmp drive_add : remove backslashes from $drive string

Alexandre Derumier aderumier at odiso.com
Sun Mar 1 08:01:26 CET 2015


since
https://git.proxmox.com/?p=qemu-server.git;a=commit;h=8ead5ec7dc342e991f2e8cef3e6b6afcba549250

the hotplug of ceph/rbd disk don't work anymore,

because we have backslashes in string

drive_add auto "file=rbd:poolceph1/vm-101-disk-10:mon_host=10.5.0.11\;10.5.0.12\;10.5.0.13:id=admin:auth_supported=cephx:keyring=/etc/pve/priv/ceph/cephzimbra.keyring,if=none,id=drive-virtio1,aio=native,cache=none,detect-zeroes=on"

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/QemuServer.pm |    1 +
 1 file changed, 1 insertion(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 9847254..8769cb8 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3394,6 +3394,7 @@ sub qemu_driveadd {
     my ($storecfg, $vmid, $device) = @_;
 
     my $drive = print_drive_full($storecfg, $vmid, $device);
+    $drive =~ s/\\//g;
     my $ret = vm_human_monitor_command($vmid, "drive_add auto \"$drive\"");
 
     # If the command succeeds qemu prints: "OK"
-- 
1.7.10.4




More information about the pve-devel mailing list