[pve-devel] [PATCH] drive_add : escape \ character

Alexandre Derumier aderumier at odiso.com
Thu Mar 5 10:34:10 CET 2015


storage.cfg
-----------
rbd mystorage
    monhost 10.5.0.11:6789; 10.5.0.12:6789; 10.5.0.13:6789

drive_add auto "file=rbd:poolceph1/vm-101-disk-8:mon_host=10.5.0.11\\:6789; 10.5.0.12\\:6789; 10.5.0.13\\:6789:id=admin:auth_supported=cephx:keyring=/etc/pve/priv/ceph/cephzimbra.keyring,if=none,id=drive-virtio2,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 6b4ad8b..bb7a7f3 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