mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-01 06:15:25 +00:00
drive schema: allow 'none' again
This commit is contained in:
parent
bb9207e0e1
commit
822c8a0776
@ -516,13 +516,26 @@ for (my $i = 0; $i < $MAX_NETS; $i++) {
|
|||||||
$confdesc->{"net$i"} = $netdesc;
|
$confdesc->{"net$i"} = $netdesc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PVE::JSONSchema::register_format('pve-volume-id-or-none', \&verify_volume_id_or_none);
|
||||||
|
sub verify_volume_id_or_none {
|
||||||
|
my ($volid, $noerr) = @_;
|
||||||
|
|
||||||
|
return $volid if $volid eq 'none';
|
||||||
|
$volid = eval { PVE::JSONSchema::check_format('pve-volume-id', $volid, '') };
|
||||||
|
if ($@) {
|
||||||
|
return undef if $noerr;
|
||||||
|
die $@;
|
||||||
|
}
|
||||||
|
return $volid;
|
||||||
|
}
|
||||||
|
|
||||||
my $drivename_hash;
|
my $drivename_hash;
|
||||||
|
|
||||||
my %drivedesc_base = (
|
my %drivedesc_base = (
|
||||||
volume => { alias => 'file' },
|
volume => { alias => 'file' },
|
||||||
file => {
|
file => {
|
||||||
type => 'string',
|
type => 'string',
|
||||||
format => 'pve-volume-id',
|
format => 'pve-volume-id-or-none',
|
||||||
default_key => 1,
|
default_key => 1,
|
||||||
format_description => 'volume',
|
format_description => 'volume',
|
||||||
description => "The drive's backing volume.",
|
description => "The drive's backing volume.",
|
||||||
|
Loading…
Reference in New Issue
Block a user