From: Dietmar Maurer Date: Wed, 22 Apr 2015 08:02:33 +0000 (+0200) Subject: use new standard option 'pve-startup-order' X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=43574f738dd5b2ed3b23cdb93f847847cc63e1a4;p=qemu-server.git use new standard option 'pve-startup-order' --- diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index b5f308ac..708b208d 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -367,12 +367,7 @@ EODESC pattern => '(now|\d{4}-\d{1,2}-\d{1,2}(T\d{1,2}:\d{1,2}:\d{1,2})?)', default => 'now', }, - startup => { - optional => 1, - type => 'string', format => 'pve-qm-startup', - typetext => '[[order=]\d+] [,up=\d+] [,down=\d+] ', - description => "Startup and shutdown behavior. Order is a non-negative number defining the general startup order. Shutdown in done with reverse ordering. Additionally you can set the 'up' or 'down' delay in seconds, which specifies a delay to wait before the next VM is started or stopped.", - }, + startup => get_standard_option('pve-startup-order'), template => { optional => 1, type => 'boolean', @@ -1695,41 +1690,6 @@ sub parse_watchdog { return $res; } -PVE::JSONSchema::register_format('pve-qm-startup', \&verify_startup); -sub verify_startup { - my ($value, $noerr) = @_; - - return $value if parse_startup($value); - - return undef if $noerr; - - die "unable to parse startup options\n"; -} - -sub parse_startup { - my ($value) = @_; - - return undef if !$value; - - my $res = {}; - - foreach my $p (split(/,/, $value)) { - next if $p =~ m/^\s*$/; - - if ($p =~ m/^(order=)?(\d+)$/) { - $res->{order} = $2; - } elsif ($p =~ m/^up=(\d+)$/) { - $res->{up} = $1; - } elsif ($p =~ m/^down=(\d+)$/) { - $res->{down} = $1; - } else { - return undef; - } - } - - return $res; -} - sub parse_usb_device { my ($value) = @_;