[pve-devel] [PATCH] qmp drive_add : remove backslashes from $drive string
Alexandre DERUMIER
aderumier at odiso.com
Mon Mar 2 07:39:16 CET 2015
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;
More information about the pve-devel
mailing list