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

Stefan Priebe s.priebe at profihost.ag
Sun Mar 1 09:23:07 CET 2015


Isn't the correct fix not to include \ in the output of print_drive_full?

I think escaping should be done in the routines using print_drive_full.

Stefan

Am 01.03.2015 um 08:01 schrieb Alexandre Derumier:
> 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"
>



More information about the pve-devel mailing list