[pve-devel] applied: [PATCH qemu-server] Fix #1361: create disk: stricter parsing of storage:size
Fabian Grünbichler
f.gruenbichler at proxmox.com
Wed May 3 11:49:40 CEST 2017
On Mon, Apr 24, 2017 at 11:12:29AM +0200, Wolfgang Bumiller wrote:
> This fixes paths such as
> /dev/disk/by-id/some-ID:0.5
> being interpreted as a request to create a 0.5G-sized disk
> in the storage named '/dev/disk/by-id/some-ID'.
> ---
> For: master, stable-4
>
> PVE/API2/Qemu.pm | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
> index 19ba5be..4cf0a56 100644
> --- a/PVE/API2/Qemu.pm
> +++ b/PVE/API2/Qemu.pm
> @@ -127,7 +127,7 @@ my $create_disks = sub {
> if (!$volid || $volid eq 'none' || $volid eq 'cdrom') {
> delete $disk->{size};
> $res->{$ds} = PVE::QemuServer::print_drive($vmid, $disk);
> - } elsif ($volid =~ m/^(([^:\s]+):)?(\d+(\.\d+)?)$/) {
> + } elsif ($volid =~ m!^(([^/:\s]+):)?(\d+(\.\d+)?)$!) {
> my ($storeid, $size) = ($2 || $default_storage, $3);
> die "no storage ID specified (and no default storage)\n" if !$storeid;
> my $defformat = PVE::Storage::storage_default_format($storecfg, $storeid);
> --
> 2.11.0
>
>
> _______________________________________________
> 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