my $lock_dir = "/var/lock/qemu-server";
mkdir $lock_dir;
-my $MAX_UNUSED_DISKS = 8;
+my $MAX_UNUSED_DISKS = 256;
# BEGIN implemented abstract methods from PVE::AbstractConfig
# we save the machine of the current config
$data->{oldmachine} = $conf->{machine};
} else {
- # if we have a 'runningmachine' entry in the snapshot
- # we use that for the forcemachine parameter,
- # else we use the old logic
+ # if we have a 'runningmachine' entry in the snapshot we use that
+ # for the forcemachine parameter, else we use the old logic
if (defined($conf->{runningmachine})) {
$data->{forcemachine} = $conf->{runningmachine};
delete $conf->{runningmachine};
# in the original config.
delete $conf->{machine} if $snap->{vmstate} && !defined($data->{oldmachine});
}
+
+ if ($conf->{vmgenid}) {
+ # tell the VM that it's another generation, so it can react
+ # appropriately, e.g. dirty-mark copies of distributed databases or
+ # re-initializing its random number generator
+ $conf->{vmgenid} = PVE::QemuServer::generate_uuid();
+ }
}
return;