]> git.proxmox.com Git - qemu-server.git/commitdiff
use new standard option 'pve-startup-order'
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 22 Apr 2015 08:02:33 +0000 (10:02 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 22 Apr 2015 08:02:33 +0000 (10:02 +0200)
PVE/QemuServer.pm

index b5f308acf664dd45168a5876610a61840d41d524..708b208d24b30abe05cdbdb6461d78c5031063b9 100644 (file)
@@ -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) = @_;