Skip to content

Commit d664399

Browse files
apply guest.cpu.features for system VMs
1 parent 62d9b91 commit d664399

File tree

3 files changed

+3
-25
lines changed

3 files changed

+3
-25
lines changed

agent/conf/agent.properties

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,16 +213,11 @@ hypervisor.type=kvm
213213
# If null (default), defaults to the VM's OS architecture
214214
#guest.cpu.arch=
215215

216-
# Specifies required CPU features for end-user VMs (non-system VMs).
216+
# Specifies required CPU features for end-user and system VMs.
217217
# These features must be present on the host CPU for VM deployment.
218218
# Multiple features should be separated by whitespace (e.g.: vmx vme).
219219
#guest.cpu.features=
220220

221-
# Specifies required CPU features for system VMs.
222-
# These features must be present on the host CPU for VM deployment.
223-
# Multiple features should be separated by whitespace (e.g.: vmx vme).
224-
#systemvm.guest.cpu.features=
225-
226221
# Disables memory ballooning on VM guests for overcommit.
227222
# By default overcommit feature enables balloon and sets currentMemory to a minimum value.
228223
#vm.memballoon.disable=false

agent/src/main/java/com/cloud/agent/properties/AgentProperties.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ public class AgentProperties{
398398
public static final Property<String> GUEST_CPU_ARCH = new Property<>("guest.cpu.arch", null, String.class);
399399

400400
/**
401-
* Specifies required CPU features for end-user VMs (non-system VMs).<br>
401+
* Specifies required CPU features for end-user and system VMs.<br>
402402
* These features must be present on the host CPU for VM deployment.<br>
403403
* Multiple features should be separated by whitespace (see example below).<br>
404404
* Possible values: vmx vme <br>
@@ -407,16 +407,6 @@ public class AgentProperties{
407407
*/
408408
public static final Property<String> GUEST_CPU_FEATURES = new Property<>("guest.cpu.features", null, String.class);
409409

410-
/**
411-
* Specifies required CPU features for system VMs.<br>
412-
* These features must be present on the host CPU for VM deployment.<br>
413-
* Multiple features should be separated by whitespace (see example below).<br>
414-
* Possible values: vmx vme <br>
415-
* Data type: String.<br>
416-
* Default value: <code>null</code>
417-
*/
418-
public static final Property<String> SYSTEMVM_GUEST_CPU_FEATURES = new Property<>("systemvm.guest.cpu.features", null, String.class);
419-
420410
/**
421411
* Disables memory ballooning on VM guests for overcommit.<br>
422412
* By default overcommit feature enables balloon and sets currentMemory to a minimum value.<br>

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -860,8 +860,6 @@ protected String getDefaultScriptsDir() {
860860

861861
protected List<String> cpuFeatures;
862862

863-
protected List<String> systemVmCpuFeatures;
864-
865863
protected enum BridgeType {
866864
NATIVE, OPENVSWITCH, TUNGSTEN
867865
}
@@ -1305,7 +1303,6 @@ public boolean configure(final String name, final Map<String, Object> params) th
13051303
}
13061304

13071305
this.cpuFeatures = parseCpuFeatures(AgentPropertiesFileHandler.getPropertyValue(AgentProperties.GUEST_CPU_FEATURES));
1308-
this.systemVmCpuFeatures = parseCpuFeatures(AgentPropertiesFileHandler.getPropertyValue(AgentProperties.SYSTEMVM_GUEST_CPU_FEATURES));
13091306

13101307
final String[] info = NetUtils.getNetworkParams(privateNic);
13111308

@@ -3014,11 +3011,7 @@ private CpuModeDef createCpuModeDef(VirtualMachineTO vmTO, int vcpus) {
30143011
String cpuModel = MapUtils.isNotEmpty(details) && details.get(VmDetailConstants.GUEST_CPU_MODEL) != null ? details.get(VmDetailConstants.GUEST_CPU_MODEL) : guestCpuModel;
30153012
cmd.setMode(cpuMode);
30163013
cmd.setModel(cpuModel);
3017-
if (VirtualMachine.Type.User.equals(vmTO.getType())) {
3018-
cmd.setFeatures(cpuFeatures);
3019-
} else if (vmTO.getType().isUsedBySystem()) {
3020-
cmd.setFeatures(systemVmCpuFeatures);
3021-
}
3014+
cmd.setFeatures(cpuFeatures);
30223015
int vCpusInDef = vmTO.getVcpuMaxLimit() == null ? vcpus : vmTO.getVcpuMaxLimit();
30233016
setCpuTopology(cmd, vCpusInDef, vmTO.getDetails());
30243017
return cmd;

0 commit comments

Comments
 (0)