mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-03 01:29:13 +00:00
use qemu's blockdev-snapshot functions
Instead of our own. The code is almost the same, but the upstream implementation uses qemu's transactional system and performs a drain() on the block device first. This seems to help avoid some issues we run into with qcow2 files when creating snapshots. Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
babecffe00
commit
eba2b72199
@ -126,6 +126,8 @@ sub cmd {
|
|||||||
$cmd->{execute} eq 'query-savevm' ||
|
$cmd->{execute} eq 'query-savevm' ||
|
||||||
$cmd->{execute} eq 'delete-drive-snapshot' ||
|
$cmd->{execute} eq 'delete-drive-snapshot' ||
|
||||||
$cmd->{execute} eq 'guest-shutdown' ||
|
$cmd->{execute} eq 'guest-shutdown' ||
|
||||||
|
$cmd->{execute} eq 'blockdev-snapshot-internal-sync' ||
|
||||||
|
$cmd->{execute} eq 'blockdev-snapshot-delete-internal-sync' ||
|
||||||
$cmd->{execute} eq 'snapshot-drive' ) {
|
$cmd->{execute} eq 'snapshot-drive' ) {
|
||||||
$timeout = 10*60; # 10 mins ?
|
$timeout = 10*60; # 10 mins ?
|
||||||
} else {
|
} else {
|
||||||
|
@ -4288,7 +4288,7 @@ sub qemu_volume_snapshot {
|
|||||||
my $running = check_running($vmid);
|
my $running = check_running($vmid);
|
||||||
|
|
||||||
if ($running && do_snapshots_with_qemu($storecfg, $volid)){
|
if ($running && do_snapshots_with_qemu($storecfg, $volid)){
|
||||||
vm_mon_cmd($vmid, "snapshot-drive", device => $deviceid, name => $snap);
|
vm_mon_cmd($vmid, 'blockdev-snapshot-internal-sync', device => $deviceid, name => $snap);
|
||||||
} else {
|
} else {
|
||||||
PVE::Storage::volume_snapshot($storecfg, $volid, $snap);
|
PVE::Storage::volume_snapshot($storecfg, $volid, $snap);
|
||||||
}
|
}
|
||||||
@ -4310,7 +4310,7 @@ sub qemu_volume_snapshot_delete {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($running && do_snapshots_with_qemu($storecfg, $volid)){
|
if ($running && do_snapshots_with_qemu($storecfg, $volid)){
|
||||||
vm_mon_cmd($vmid, "delete-drive-snapshot", device => $deviceid, name => $snap);
|
vm_mon_cmd($vmid, 'blockdev-snapshot-delete-internal-sync', device => $deviceid, name => $snap);
|
||||||
} else {
|
} else {
|
||||||
PVE::Storage::volume_snapshot_delete($storecfg, $volid, $snap, $running);
|
PVE::Storage::volume_snapshot_delete($storecfg, $volid, $snap, $running);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user