add_machine_type() is used to set emulated machine type.
-M machine : Select the emulated machine ("-M ?" for list)
Signed-off-by: Golita Yue <[email protected]>
Signed-off-by: Amos Kong <[email protected]>
---
client/virt/base.cfg.sample | 4 ++++
client/virt/kvm_vm.py | 7 +++++++
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/client/virt/base.cfg.sample b/client/virt/base.cfg.sample
index 92806dc..04bd00f 100644
--- a/client/virt/base.cfg.sample
+++ b/client/virt/base.cfg.sample
@@ -38,6 +38,10 @@ usb_type_tablet1 = usb-tablet
# USB Controller type which device uses.
usb_controller_tablet1 = uhci
+# Emulated machine type, run following command to see supported machine type.
+# qemu-kvm -M ?
+# machine_type = pc
+
##### Low-level parameters for platform, networking, block, and usb devices.
diff --git a/client/virt/kvm_vm.py b/client/virt/kvm_vm.py
index 20b2a02..80ea453 100644
--- a/client/virt/kvm_vm.py
+++ b/client/virt/kvm_vm.py
@@ -601,6 +601,9 @@ class VM(virt_vm.BaseVM):
else:
return ""
+ def add_machine_type(help, machine_type):
+ return " -M %s" % machine_type
+
def add_usb(help, usb_id, usb_type, multifunction=False,
masterbus=None, firstport=None, freq=None):
if not has_option(help, "device"):
@@ -814,6 +817,10 @@ class VM(virt_vm.BaseVM):
flags = params.get("cpu_model_flags")
qemu_cmd += add_cpu_flags(help, cpu_model, vendor, flags)
+ machine_type = params.get("machine_type")
+ if machine_type:
+ qemu_cmd += add_machine_type(help, machine_type)
+
for cdrom in params.objects("cdroms"):
cd_format = params.get("cd_format", "")
cdrom_params = params.object_params(cdrom)
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest