foreach my $name (keys %$snaphash) {
my $d = $snaphash->{$name};
- my $item = { name => $name, description => $d->{description} };
+ my $item = {
+ name => $name,
+ snaptime => $d->{snaptime} || 0,
+ description => $d->{description} || '',
+ };
$item->{parent} = $d->{parent} if $d->{parent};
push @$res, $item;
}
optional => 1,
description => "Parent snapshot name. This is used internally, and should not be modified.",
}),
+ snaptime => {
+ optional => 1,
+ description => "Timestamp for snapshots.",
+ type => 'integer',
+ minimum => 0,
+ },
};
# what about other qemu settings ?
my $prop = shift;
foreach my $opt (keys %$confdesc) {
+ next if $opt eq 'parent' || $opt eq 'snaptime';
$prop->{$opt} = $confdesc->{$opt};
}
foreach my $k (keys %$source) {
next if $k eq 'snapshots';
+ next if $k eq 'snapstate';
+ next if $k eq 'snaptime';
next if $k eq 'lock';
next if $k eq 'digest';
next if $k =~ m/^unused\d+$/;
$snap = $conf->{snapshots}->{$snapname} = {
snapstate => "prepare",
+ snaptime => time(),
};
&$snapshot_copy_config($conf, $snap);