]> git.proxmox.com Git - qemu-server.git/commitdiff
drive_add : escape \ character
authorAlexandre Derumier <aderumier@odiso.com>
Thu, 5 Mar 2015 09:34:10 +0000 (10:34 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 6 Mar 2015 09:19:09 +0000 (10:19 +0100)
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@odiso.com>
PVE/QemuServer.pm

index f46302ef4048f33bbb72f233a66f412b50ecf754..4c62106b845593afc57071913d5ac01abec1c41e 100644 (file)
@@ -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"