Skip to content

Commit 84148e6

Browse files
apply guest.cpu.features for system VMs
1 parent c2d53df commit 84148e6

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
@@ -390,7 +390,7 @@ public class AgentProperties{
390390
public static final Property<String> GUEST_CPU_ARCH = new Property<>("guest.cpu.arch", null, String.class);
391391

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

402-
/**
403-
* Specifies required CPU features for system VMs.<br>
404-
* These features must be present on the host CPU for VM deployment.<br>
405-
* Multiple features should be separated by whitespace (see example below).<br>
406-
* Possible values: vmx vme <br>
407-
* Data type: String.<br>
408-
* Default value: <code>null</code>
409-
*/
410-
public static final Property<String> SYSTEMVM_GUEST_CPU_FEATURES = new Property<>("systemvm.guest.cpu.features", null, String.class);
411-
412402
/**
413403
* Disables memory ballooning on VM guests for overcommit.<br>
414404
* 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
@@ -843,8 +843,6 @@ protected String getDefaultScriptsDir() {
843843

844844
protected List<String> cpuFeatures;
845845

846-
protected List<String> systemVmCpuFeatures;
847-
848846
protected enum BridgeType {
849847
NATIVE, OPENVSWITCH, TUNGSTEN
850848
}
@@ -1286,7 +1284,6 @@ public boolean configure(final String name, final Map<String, Object> params) th
12861284
}
12871285

12881286
this.cpuFeatures = parseCpuFeatures(AgentPropertiesFileHandler.getPropertyValue(AgentProperties.GUEST_CPU_FEATURES));
1289-
this.systemVmCpuFeatures = parseCpuFeatures(AgentPropertiesFileHandler.getPropertyValue(AgentProperties.SYSTEMVM_GUEST_CPU_FEATURES));
12901287

12911288
final String[] info = NetUtils.getNetworkParams(privateNic);
12921289

@@ -2995,11 +2992,7 @@ private CpuModeDef createCpuModeDef(VirtualMachineTO vmTO, int vcpus) {
29952992
String cpuModel = MapUtils.isNotEmpty(details) && details.get(VmDetailConstants.GUEST_CPU_MODEL) != null ? details.get(VmDetailConstants.GUEST_CPU_MODEL) : guestCpuModel;
29962993
cmd.setMode(cpuMode);
29972994
cmd.setModel(cpuModel);
2998-
if (VirtualMachine.Type.User.equals(vmTO.getType())) {
2999-
cmd.setFeatures(cpuFeatures);
3000-
} else if (vmTO.getType().isUsedBySystem()) {
3001-
cmd.setFeatures(systemVmCpuFeatures);
3002-
}
2995+
cmd.setFeatures(cpuFeatures);
30032996
int vCpusInDef = vmTO.getVcpuMaxLimit() == null ? vcpus : vmTO.getVcpuMaxLimit();
30042997
setCpuTopology(cmd, vCpusInDef, vmTO.getDetails());
30052998
return cmd;

0 commit comments

Comments
 (0)