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

Wolfgang Bumiller w.bumiller at proxmox.com
Mon Feb 5 14:39:28 CET 2018


applied

On Thu, Feb 01, 2018 at 02:51:05PM +0100, Wolfgang Link wrote:
> 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