[pve-devel] [RFC V2 qemu-server] Make the smbios UUID unique if --unique is used.

Wolfgang Link w.link at proxmox.com
Thu Feb 1 14:51:05 CET 2018


When we clone a VM we also make the smbios unique.
---
[RFC V2]
Change only uuid and not the hole smbios string.

 PVE/QemuServer.pm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 9c0de45..6692888 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -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;
     }
-- 
2.11.0





More information about the pve-devel mailing list