[pve-devel] [PATCH qemu-server] parse_vm_config: allow spaces in values

Wolfgang Bumiller w.bumiller at proxmox.com
Wed Mar 9 14:54:32 CET 2016


Ultimately we'll probably want this parser moved to AbstractConfig
(and the one in LXC, too), but for now this should fix the problem
reported in the re-opened #153.

> On March 9, 2016 at 2:51 PM Wolfgang Bumiller <w.bumiller at proxmox.com> wrote:
> 
> 
> Serial numbers can have spaces (and qemu space-pads them,
> but on the right side and sometimes they need to be
> left-padded).
> parse_property_string() can work it, so it's already
> possible to add them, but they'll be stuck in the [pending]
> section and never applied.
> ---
>  PVE/QemuServer.pm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index c0907bc..d13ad54 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -2002,7 +2002,7 @@ sub parse_vm_config {
>  	    } else {
>  		warn "vm $vmid - propertry 'delete' is only allowed in [PENDING]\n";
>  	    }
> -	} elsif ($line =~ m/^([a-z][a-z_]*\d*):\s*(\S+)\s*$/) {
> +	} elsif ($line =~ m/^([a-z][a-z_]*\d*):\s*(.+?)\s*$/) {
>  	    my $key = $1;
>  	    my $value = $2;
>  	    eval { $value = check_type($key, $value); };
> -- 
> 2.1.4
> 
> 
> _______________________________________________
> 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