]> git.proxmox.com Git - qemu-server.git/blobdiff - PVE/QemuConfig.pm
config: NIC macaddr: enforce unicast MAC addresses
[qemu-server.git] / PVE / QemuConfig.pm
index de564b760278ee03d9e80139d450fa61d123a58a..6ba0cc3d1773fb047ddcdd2a22001f020ab7d0ad 100644 (file)
@@ -20,7 +20,7 @@ mkdir $confdir;
 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
 
@@ -286,9 +286,8 @@ sub __snapshot_rollback_hook {
        # 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};
@@ -301,6 +300,13 @@ sub __snapshot_rollback_hook {
            # 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;