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

Alexandre DERUMIER aderumier at odiso.com
Mon Mar 2 08:54:50 CET 2015


>>I wonder if it works with standard shell quotin?

Not working


>>virtio1: hotplug problem - adding drive failed: invalid parameter value: on'

$drive string:

'file=rbd:poolceph1/vm-101-disk-6: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'


----- Mail original -----
De: "aderumier" <aderumier at odiso.com>
À: "dietmar" <dietmar at proxmox.com>
Cc: "pve-devel" <pve-devel at pve.proxmox.com>
Envoyé: Lundi 2 Mars 2015 07:39:16
Objet: Re: [pve-devel] [PATCH] qmp drive_add : remove backslashes from $drive string

I'll test today. 

The initial bug was space in the $drive string. 
That's seem strange. (Maybe because user setup ceph monitor with spaces ? mon1 ; mon2 ; mon3 ? ) 



----- Mail original ----- 
De: "dietmar" <dietmar at proxmox.com> 
À: "aderumier" <aderumier at odiso.com>, "pve-devel" <pve-devel at pve.proxmox.com> 
Envoyé: Lundi 2 Mars 2015 07:08:14 
Objet: Re: [pve-devel] [PATCH] qmp drive_add : remove backslashes from $drive string 

Hi Alexandre, 

I wonder if it works with standard shell quotin? Please can you test? 


diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm 
index 6ca95bc..74ed9eb 100644 
--- a/PVE/QemuServer.pm 
+++ b/PVE/QemuServer.pm 
@@ -3393,8 +3393,8 @@ sub qemu_objectdel { 
sub qemu_driveadd { 
my ($storecfg, $vmid, $device) = @_; 

- my $drive = print_drive_full($storecfg, $vmid, $device); 
- my $ret = vm_human_monitor_command($vmid, "drive_add auto \"$drive\""); 
+ my $drive = PVE::Tools::shellquote(print_drive_full($storecfg, $vmid, 
$device)); 
+ my $ret = vm_human_monitor_command($vmid, "drive_add auto $drive"); 

# If the command succeeds qemu prints: "OK" 
return 1 if $ret =~ m/OK/s; 

_______________________________________________ 
pve-devel mailing list 
pve-devel at pve.proxmox.com 
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel 



More information about the pve-devel mailing list