Skip to content

Commit 96cabf7

Browse files
authored
[KVM] Allow passing the OS type machine for KVM XML domains through VM setting (#11569)
* [KVM] Allow passing OS type machine to XML domains
1 parent 23a53e2 commit 96cabf7

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

api/src/main/java/com/cloud/vm/VmDetailConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public interface VmDetailConstants {
4141
String KVM_VNC_PORT = "kvm.vnc.port";
4242
String KVM_VNC_ADDRESS = "kvm.vnc.address";
4343
String KVM_VNC_PASSWORD = "kvm.vnc.password";
44+
String KVM_GUEST_OS_MACHINE_TYPE = "kvm.guest.os.machine.type";
4445

4546
// KVM specific, custom virtual GPU hardware
4647
String VIDEO_HARDWARE = "video.hardware";

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3306,6 +3306,9 @@ protected GuestDef createGuestFromSpec(VirtualMachineTO vmTO, LibvirtVMDef vm, S
33063306
}
33073307
}
33083308
guest.setIothreads(customParams.containsKey(VmDetailConstants.IOTHREADS));
3309+
if (customParams.containsKey(VmDetailConstants.KVM_GUEST_OS_MACHINE_TYPE)) {
3310+
guest.setMachineType(customParams.get(VmDetailConstants.KVM_GUEST_OS_MACHINE_TYPE));
3311+
}
33093312
}
33103313
guest.setUuid(uuid);
33113314
if(!isGuestS390x()) {

0 commit comments

Comments
 (0)