]> git.proxmox.com Git - qemu-server.git/commitdiff
Make the smbios UUID unique if --unique is used.
authorWolfgang Link <w.link@proxmox.com>
Thu, 1 Feb 2018 13:51:05 +0000 (14:51 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 5 Feb 2018 13:38:41 +0000 (14:38 +0100)
When we clone a VM we also make the smbios unique.

PVE/QemuServer.pm

index 9c0de45e6221f89a5492a10208f822b100a7c4d2..669288844bfd16ddb190d4328aa3f2ce3fa23dbc 100644 (file)
@@ -5347,6 +5347,13 @@ sub restore_update_config_line {
        } else {
            print $outfd $line;
        }
+    } elsif (($line =~ m/^(smbios1: )(.*)/) && $unique) {
+       my ($uuid, $uuid_str);
+       UUID::generate($uuid);
+       UUID::unparse($uuid, $uuid_str);
+       my $smbios1 = parse_smbios1($2);
+       $smbios1->{uuid} = $uuid_str;
+       print $outfd $1.print_smbios1($smbios1)."\n";
     } else {
        print $outfd $line;
     }