mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-12 21:28:59 +00:00
make 'parent' a real option
This commit is contained in:
parent
79e57b294c
commit
b7ba6b7933
@ -22,6 +22,7 @@ use Storable qw(dclone);
|
|||||||
use PVE::Exception qw(raise raise_param_exc);
|
use PVE::Exception qw(raise raise_param_exc);
|
||||||
use PVE::Storage;
|
use PVE::Storage;
|
||||||
use PVE::Tools qw(run_command lock_file file_read_firstline);
|
use PVE::Tools qw(run_command lock_file file_read_firstline);
|
||||||
|
use PVE::JSONSchema qw(get_standard_option);
|
||||||
use PVE::Cluster qw(cfs_register_file cfs_read_file cfs_write_file cfs_lock_file);
|
use PVE::Cluster qw(cfs_register_file cfs_read_file cfs_write_file cfs_lock_file);
|
||||||
use PVE::INotify;
|
use PVE::INotify;
|
||||||
use PVE::ProcFSTools;
|
use PVE::ProcFSTools;
|
||||||
@ -389,6 +390,10 @@ EODESCR
|
|||||||
enum => [ qw(486 athlon pentium pentium2 pentium3 coreduo core2duo kvm32 kvm64 qemu32 qemu64 phenom cpu64-rhel6 cpu64-rhel5 Conroe Penryn Nehalem Westmere Opteron_G1 Opteron_G2 Opteron_G3 host) ],
|
enum => [ qw(486 athlon pentium pentium2 pentium3 coreduo core2duo kvm32 kvm64 qemu32 qemu64 phenom cpu64-rhel6 cpu64-rhel5 Conroe Penryn Nehalem Westmere Opteron_G1 Opteron_G2 Opteron_G3 host) ],
|
||||||
default => 'qemu64',
|
default => 'qemu64',
|
||||||
},
|
},
|
||||||
|
parent => get_standard_option('pve-snapshot-name', {
|
||||||
|
optional => 1,
|
||||||
|
description => "Parent snapshot name. This is used internally, and should not be modified.",
|
||||||
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
# what about other qemu settings ?
|
# what about other qemu settings ?
|
||||||
@ -1583,8 +1588,6 @@ sub parse_vm_config {
|
|||||||
|
|
||||||
if ($line =~ m/^(description):\s*(.*\S)\s*$/) {
|
if ($line =~ m/^(description):\s*(.*\S)\s*$/) {
|
||||||
$descr .= PVE::Tools::decode_text($2);
|
$descr .= PVE::Tools::decode_text($2);
|
||||||
} elsif ($line =~ m/parent:\s*([a-z][a-z0-9_\-]+)\s*$/) {
|
|
||||||
$conf->{parent} = $1;
|
|
||||||
} elsif ($line =~ m/snapstate:\s*(prepare|delete)\s*$/) {
|
} elsif ($line =~ m/snapstate:\s*(prepare|delete)\s*$/) {
|
||||||
$conf->{snapstate} = $1;
|
$conf->{snapstate} = $1;
|
||||||
} elsif ($line =~ m/^(args):\s*(.*\S)\s*$/) {
|
} elsif ($line =~ m/^(args):\s*(.*\S)\s*$/) {
|
||||||
@ -1650,8 +1653,7 @@ sub write_vm_config {
|
|||||||
|
|
||||||
my $new_volids = {};
|
my $new_volids = {};
|
||||||
foreach my $key (keys %$conf) {
|
foreach my $key (keys %$conf) {
|
||||||
next if $key eq 'digest' || $key eq 'description' ||
|
next if $key eq 'digest' || $key eq 'description' || $key eq 'snapshots';
|
||||||
$key eq 'snapshots' || $key eq 'parent';
|
|
||||||
my $value = $conf->{$key};
|
my $value = $conf->{$key};
|
||||||
eval { $value = check_type($key, $value); };
|
eval { $value = check_type($key, $value); };
|
||||||
die "unable to parse value of '$key' - $@" if $@;
|
die "unable to parse value of '$key' - $@" if $@;
|
||||||
|
Loading…
Reference in New Issue
Block a user