[pve-devel] [PATCH storage 2/3] rbd: use address-list for monhost

Wolfgang Bumiller w.bumiller at proxmox.com
Wed Jul 6 16:11:07 CEST 2016


I meant to Cc Alwin Antreich on this patch but forgot, so there.
(Not sure if you're watching the pve-devel list.)

Note that while this is a backend patch it'll also show an error on the
GUI when clicking OK. A GUI update to mark the field as red while typing
still has to be made.

On Wed, Jul 06, 2016 at 04:04:49PM +0200, Wolfgang Bumiller wrote:
> This way we get parameter verification on monitor addresses
> as well as the ability to pass multiple `--monhost`
> arguments to `pvesm add`.
> 
> Since our '-list' schemas default to using commas we now
> need to properly support these, so all uses of the monhost
> property now replace all of semicolon, space or comma into
> the currently required character.
> This should fix the issues reported by Alwin Antreich on the
> pve-user list.
> ---
>  PVE/Storage/RBDPlugin.pm | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm
> index ced9af0..55c307b 100644
> --- a/PVE/Storage/RBDPlugin.pm
> +++ b/PVE/Storage/RBDPlugin.pm
> @@ -29,7 +29,7 @@ my $rbd_cmd = sub {
>      my ($scfg, $storeid, $op, @options) = @_;
>  
>      my $monhost = $scfg->{monhost};
> -    $monhost =~ s/;/,/g;
> +    $monhost =~ s/[; ]+/,/g;
>  
>      my $keyring = "/etc/pve/priv/ceph/${storeid}.keyring";
>      my $pool =  $scfg->{pool} ? $scfg->{pool} : 'rbd';
> @@ -56,7 +56,7 @@ my $rados_cmd = sub {
>      my ($scfg, $storeid, $op, @options) = @_;
>  
>      my $monhost = $scfg->{monhost};
> -    $monhost =~ s/;/,/g;
> +    $monhost =~ s/[; ]+/,/g;
>  
>      my $keyring = "/etc/pve/priv/ceph/${storeid}.keyring";
>      my $pool =  $scfg->{pool} ? $scfg->{pool} : 'rbd';
> @@ -248,7 +248,7 @@ sub properties {
>      return {
>  	monhost => {
>  	    description => "Monitors daemon ips.",
> -	    type => 'string',
> +	    type => 'string', format => 'address-list',
>  	},
>  	pool => {
>  	    description => "Pool.",
> @@ -303,6 +303,7 @@ sub path {
>      return ("/dev/rbd/$pool/$name", $vmid, $vtype) if $scfg->{krbd};
>  
>      my $monhost = $scfg->{monhost};
> +    $monhost =~ s/[, ]+/;/g;
>      $monhost =~ s/:/\\:/g;
>  
>      my $username =  $scfg->{username} ? $scfg->{username} : 'admin';
> -- 
> 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