On 18/04/12 16:36, Lin Qing wrote:
> --machine MACHINE :set the machine type to emulate.
> add libvirt command line parameter "--machine ?" wrapper in libvirt_vm.py.
>
> Signed-off-by: Qing Lin<[email protected]>
> ---
> client/virt/libvirt_vm.py | 10 ++++++++++
> 1 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/client/virt/libvirt_vm.py b/client/virt/libvirt_vm.py
> index 355ac5e..6512cb9 100644
> --- a/client/virt/libvirt_vm.py
> +++ b/client/virt/libvirt_vm.py
> @@ -663,6 +663,12 @@ class VM(virt_vm.BaseVM):
> def add_name(help, name):
> return " --name '%s'" % name
>
> + def add_machine_type(help, machine_type):
> + if has_option(help, "machine"):
> + return " --machine %s" % machine_type
qemu-upstream has "-machine" option, "-M" is an alias.
qemu-kvm-rhel6 only has "-M" option.
I would add option check in kvm_vm.py:
def add_machine_type(help, machine_type):
- return " -M %s" % machine_type
+ if has_option(help, "machine") or has_option(help, "M"):
+ return " -M %s" % machine_type
+ else:
+ return ""
> + else:
> + return ""
> +
> def add_hvm_or_pv(help, hvm_or_pv):
> if hvm_or_pv == "hvm":
> return " --hvm --accelerate"
> @@ -846,6 +852,10 @@ class VM(virt_vm.BaseVM):
> # Add the VM's name
> virt_install_cmd += add_name(help, name)
>
> + machine_type = params.get("machine_type")
> + if machine_type:
> + virt_install_cmd += add_machine_type(help, machine_type)
> +
> mem = params.get("mem")
> if mem:
> virt_install_cmd += add_mem(help, mem)
>
--
Amos.
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest