followup code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2019-01-30 15:08:15 +01:00
parent 2a68ec7893
commit 87d92707b6
2 changed files with 7 additions and 11 deletions

View File

@ -854,14 +854,12 @@ __PACKAGE__->register_method({
my $conf = PVE::QemuConfig->load_config($param->{vmid});
my $snapname = $param->{snapshot};
if ($snapname) {
if (my $snapname = $param->{snapshot}) {
my $snapshot = $conf->{snapshots}->{$snapname};
die "snapshot '$snapname' does not exist\n"
if !defined($snapshot);
die "snapshot '$snapname' does not exist\n" if !defined($snapshot);
$snapshot->{digest} = $conf->{digest}; # keep file digest for API
# we need the digest of the file
$snapshot->{digest} = $conf->{digest};
$conf = $snapshot;
}

View File

@ -5378,12 +5378,10 @@ sub vm_commandline {
if ($snapname) {
my $snapshot = $conf->{snapshots}->{$snapname};
die "snapshot '$snapname' does not exist\n"
if !defined($snapshot);
my $digest = $conf->{digest};
die "snapshot '$snapname' does not exist\n" if !defined($snapshot);
$snapshot->{digest} = $conf->{digest}; # keep file digest for API
# we need the digest of the file
$snapshot->{digest} = $conf->{digest};
$conf = $snapshot;
}