mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-12 21:28:59 +00:00
Make snapshot_save_vmstate proper sub
This commit is contained in:
parent
09b1142906
commit
afa5eae56a
@ -5933,7 +5933,7 @@ my $alloc_vmstate_volid = sub {
|
|||||||
return $volid;
|
return $volid;
|
||||||
};
|
};
|
||||||
|
|
||||||
my $snapshot_save_vmstate = sub {
|
sub snapshot_save_vmstate {
|
||||||
my ($vmid, $conf, $snapname, $storecfg) = @_;
|
my ($vmid, $conf, $snapname, $storecfg) = @_;
|
||||||
|
|
||||||
my $snap = $conf->{snapshots}->{$snapname};
|
my $snap = $conf->{snapshots}->{$snapname};
|
||||||
@ -5942,7 +5942,7 @@ my $snapshot_save_vmstate = sub {
|
|||||||
# always overwrite machine if we save vmstate. This makes sure we
|
# always overwrite machine if we save vmstate. This makes sure we
|
||||||
# can restore it later using correct machine type
|
# can restore it later using correct machine type
|
||||||
$snap->{machine} = get_current_qemu_machine($vmid);
|
$snap->{machine} = get_current_qemu_machine($vmid);
|
||||||
};
|
}
|
||||||
|
|
||||||
sub snapshot_prepare {
|
sub snapshot_prepare {
|
||||||
my ($vmid, $snapname, $save_vmstate, $comment) = @_;
|
my ($vmid, $snapname, $save_vmstate, $comment) = @_;
|
||||||
@ -5969,7 +5969,7 @@ sub snapshot_prepare {
|
|||||||
$snap = $conf->{snapshots}->{$snapname} = {};
|
$snap = $conf->{snapshots}->{$snapname} = {};
|
||||||
|
|
||||||
if ($save_vmstate && check_running($vmid)) {
|
if ($save_vmstate && check_running($vmid)) {
|
||||||
&$snapshot_save_vmstate($vmid, $conf, $snapname, $storecfg);
|
snapshot_save_vmstate($vmid, $conf, $snapname, $storecfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
&$snapshot_copy_config($conf, $snap);
|
&$snapshot_copy_config($conf, $snap);
|
||||||
|
Loading…
Reference in New Issue
Block a user