coreduo => 'GenuineIntel',
core2duo => 'GenuineIntel',
Conroe => 'GenuineIntel',
- Penryn => 'GenuineIntel',
+ Penryn => 'GenuineIntel',
Nehalem => 'GenuineIntel',
+ 'Nehalem-IBRS' => 'GenuineIntel',
Westmere => 'GenuineIntel',
+ 'Westmere-IBRS' => 'GenuineIntel',
SandyBridge => 'GenuineIntel',
+ 'SandyBridge-IBRS' => 'GenuineIntel',
IvyBridge => 'GenuineIntel',
+ 'IvyBridge-IBRS' => 'GenuineIntel',
Haswell => 'GenuineIntel',
+ 'Haswell-IBRS' => 'GenuineIntel',
'Haswell-noTSX' => 'GenuineIntel',
+ 'Haswell-noTSX-IBRS' => 'GenuineIntel',
Broadwell => 'GenuineIntel',
+ 'Broadwell-IBRS' => 'GenuineIntel',
'Broadwell-noTSX' => 'GenuineIntel',
+ 'Broadwell-noTSX-IBRS' => 'GenuineIntel',
'Skylake-Client' => 'GenuineIntel',
-
+ 'Skylake-Client-IBRS' => 'GenuineIntel',
+ 'Skylake-Server' => 'GenuineIntel',
+ 'Skylake-Server-IBRS' => 'GenuineIntel',
+
# AMD CPUs
athlon => 'AuthenticAMD',
phenom => 'AuthenticAMD',
kvm64 => 'default',
qemu32 => 'default',
qemu64 => 'default',
+ max => 'default',
};
+my $cpu_flag = qr/[+-](pcid|spec-ctrl)/;
+
my $cpu_fmt = {
cputype => {
description => "Emulated CPU type.",
default => 0
},
flags => {
- description => "Override CPU flags. Currently only the 'pcid' flag is supported."
- . " Use '+pcid' or '-pcid' to enable or disable."
- . " This takes precedence over flags coming from the cpu type or changed implicitly via the OS type.",
- format_description => 'flaglist',
+ description => "List of additional CPU flags separated by ';'."
+ . " Use '+FLAG' to enable, '-FLAG' to disable a flag."
+ . " Currently supported flags: 'pcid', 'spec-ctrl'.",
+ format_description => '+FLAG[;-FLAG...]',
type => 'string',
- pattern => '[+-]pcid',
+ pattern => qr/$cpu_flag(;$cpu_flag)*/,
optional => 1,
- default => '',
},
};
}
my $opts = '';
- my @qemu_drive_options = qw(heads secs cyls trans media format cache snapshot rerror werror aio discard);
+ my @qemu_drive_options = qw(heads secs cyls trans media format cache rerror werror aio discard);
foreach my $o (@qemu_drive_options) {
$opts .= ",$o=$drive->{$o}" if $drive->{$o};
}
+
+ # snapshot only accepts on|off
+ if (defined($drive->{snapshot})) {
+ my $v = $drive->{snapshot} ? 'on' : 'off';
+ $opts .= ",snapshot=$v";
+ }
+
foreach my $type (['', '-total'], [_rd => '-read'], [_wr => '-write']) {
my ($dir, $qmpname) = @$type;
if (my $v = $drive->{"mbps$dir"}) {
$d->{template} = PVE::QemuConfig->is_template($conf);
+ $d->{serial} = 1 if conf_has_serial($conf);
+
$res->{$vmid} = $d;
}
}
}
+sub conf_has_serial {
+ my ($conf) = @_;
+
+ for (my $i = 0; $i < $MAX_SERIAL_PORTS; $i++) {
+ if ($conf->{"serial$i"}) {
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
sub vga_conf_has_spice {
my ($vga) = @_;
$kvm_off = 1 if $cpuconf->{hidden};
if (defined(my $flags = $cpuconf->{flags})) {
- push @$cpuFlags, $flags;
+ push @$cpuFlags, split(";", $flags);
}
}
} 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;
}