This hook runs before and after creating volume snapshots,
as well as after unfreezing. Only needed for Qemu right now,
so the base case in PVE::AbstractConfig is a noop.
die "abstract method - implement me\n";
}
die "abstract method - implement me\n";
}
+# Code run before and after creating all the volume snapshots
+# base: noop
+sub __snapshot_create_vol_snapshots_hook {
+ my ($class, $vmid, $snap, $running, $hook) = @_;
+
+ return;
+}
+
# Create the volume snapshots for the VM/CT.
sub __snapshot_create_vol_snapshot {
my ($class, $vmid, $vs, $volume, $snapname) = @_;
# Create the volume snapshots for the VM/CT.
sub __snapshot_create_vol_snapshot {
my ($class, $vmid, $vs, $volume, $snapname) = @_;
$class->__snapshot_freeze($vmid, 0);
}
$class->__snapshot_freeze($vmid, 0);
}
+ $class->__snapshot_create_vol_snapshots_hook($vmid, $snap, $running, "before");
+
$class->__snapshot_foreach_volume($snap, sub {
my ($vs, $volume) = @_;
$class->__snapshot_foreach_volume($snap, sub {
my ($vs, $volume) = @_;
my $err = $@;
if ($running) {
my $err = $@;
if ($running) {
+ $class->__snapshot_create_vol_snapshots_hook($vmid, $snap, $running, "after");
if ($freezefs) {
$class->__snapshot_freeze($vmid, 1);
}
if ($freezefs) {
$class->__snapshot_freeze($vmid, 1);
}
+ $class->__snapshot_create_vol_snapshots_hook($vmid, $snap, $running, "after-unfreeze");