Skip to content

Commit 739c4e7

Browse files
apply guest.cpu.features for system VMs
1 parent bdc6f60 commit 739c4e7

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

427427
/**
428-
* Specifies required CPU features for end-user VMs (non-system VMs).<br>
428+
* Specifies required CPU features for end-user and system VMs.<br>
429429
* These features must be present on the host CPU for VM deployment.<br>
430430
* Multiple features should be separated by whitespace (see example below).<br>
431431
* Possible values: vmx vme <br>
@@ -434,16 +434,6 @@ public class AgentProperties{
434434
*/
435435
public static final Property<String> GUEST_CPU_FEATURES = new Property<>("guest.cpu.features", null, String.class);
436436

437-
/**
438-
* Specifies required CPU features for system VMs.<br>
439-
* These features must be present on the host CPU for VM deployment.<br>
440-
* Multiple features should be separated by whitespace (see example below).<br>
441-
* Possible values: vmx vme <br>
442-
* Data type: String.<br>
443-
* Default value: <code>null</code>
444-
*/
445-
public static final Property<String> SYSTEMVM_GUEST_CPU_FEATURES = new Property<>("systemvm.guest.cpu.features", null, String.class);
446-
447437
/**
448438
* Disables memory ballooning on VM guests for overcommit.<br>
449439
* 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
@@ -869,8 +869,6 @@ protected String getDefaultScriptsDir() {
869869

870870
protected List<String> cpuFeatures;
871871

872-
protected List<String> systemVmCpuFeatures;
873-
874872
protected enum BridgeType {
875873
NATIVE, OPENVSWITCH, TUNGSTEN
876874
}
@@ -1319,7 +1317,6 @@ public boolean configure(final String name, final Map<String, Object> params) th
13191317
}
13201318

13211319
this.cpuFeatures = parseCpuFeatures(AgentPropertiesFileHandler.getPropertyValue(AgentProperties.GUEST_CPU_FEATURES));
1322-
this.systemVmCpuFeatures = parseCpuFeatures(AgentPropertiesFileHandler.getPropertyValue(AgentProperties.SYSTEMVM_GUEST_CPU_FEATURES));
13231320

13241321
final String[] info = NetUtils.getNetworkParams(privateNic);
13251322

@@ -3221,11 +3218,7 @@ private CpuModeDef createCpuModeDef(VirtualMachineTO vmTO, int vcpus) {
32213218
String cpuModel = MapUtils.isNotEmpty(details) && details.get(VmDetailConstants.GUEST_CPU_MODEL) != null ? details.get(VmDetailConstants.GUEST_CPU_MODEL) : guestCpuModel;
32223219
cmd.setMode(cpuMode);
32233220
cmd.setModel(cpuModel);
3224-
if (VirtualMachine.Type.User.equals(vmTO.getType())) {
3225-
cmd.setFeatures(cpuFeatures);
3226-
} else if (vmTO.getType().isUsedBySystem()) {
3227-
cmd.setFeatures(systemVmCpuFeatures);
3228-
}
3221+
cmd.setFeatures(cpuFeatures);
32293222
int vCpusInDef = vmTO.getVcpuMaxLimit() == null ? vcpus : vmTO.getVcpuMaxLimit();
32303223
setCpuTopology(cmd, vCpusInDef, vmTO.getDetails());
32313224
return cmd;

0 commit comments

Comments
 (0)