mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-29 20:58:54 +00:00
new startup option to define startup order
This commit is contained in:
parent
71c11a8301
commit
59411c4e10
2
Makefile
2
Makefile
@ -2,7 +2,7 @@ RELEASE=2.0
|
||||
|
||||
VERSION=2.0
|
||||
PACKAGE=qemu-server
|
||||
PKGREL=38
|
||||
PKGREL=39
|
||||
|
||||
DESTDIR=
|
||||
PREFIX=/usr
|
||||
|
@ -320,6 +320,12 @@ 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.",
|
||||
},
|
||||
args => {
|
||||
optional => 1,
|
||||
type => 'string',
|
||||
@ -1244,6 +1250,41 @@ 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) = @_;
|
||||
|
||||
|
@ -1,3 +1,9 @@
|
||||
qemu-server (2.0-39) unstable; urgency=low
|
||||
|
||||
* new startup option to define startup order.
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Thu, 19 Apr 2012 14:26:04 +0200
|
||||
|
||||
qemu-server (2.0-38) unstable; urgency=low
|
||||
|
||||
* add directsync cache mode
|
||||
|
Loading…
Reference in New Issue
Block a user