KVM-test: update command line for monitor

Changes from V4:
 - Code cleanup.
 - Add 'monitor_name' argument.
 - Use '_add_option' function to paste option.
 - Create human monitor if qmp is unsupported
   in VM.create method.

Changes from V3:
 - Fix of random monitor id
    Random serial/monitor id causes qemu cmdline
    comparison always failed, we could not combin
    many tests together.
    Add unique monitor_name to monitor ID

Changes from V2:
 - Create human monitor when host doesn't
   support qmp monitor

Changes from V1:
 - Check qmp option support when dealing with
   qmp monitor. Some qemu-kvm do not support
   qmp option. So we should check qmp option
   support first.

Signed-off-by: Chen Cao <kcao@redhat.com>
Signed-off-by: Feng Yang <fyang@redhat.com>
Signed-off-by: Amos Kong <akong@redhat.com>
Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
KVM-test: update command line for serial

tested with unattened_install.*

Changes from V2:
 - Code cleanup.
 - Use '_add_option' function to paste option.

Changes from V1:
 - Fix of random serial id
    Random serial/monitor id causes qemu cmdline
    comparison always failed, we could not combin
    many tests together.
    Guest only has one serial, so replace randome
    string in serial_id with 'self.instance'.

Signed-off-by: Chen Cao <kcao@redhat.com>
Signed-off-by: Amos Kong <akong@redhat.com>
Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
KVM-test: make pci_addr in make_qemu_command configurable

Changes from V1:
 - Introduce some VMPCIError classes for PCI device error.

Signed-off-by: Chen Cao <kcao@redhat.com>
Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
KVM-test: Add -enable-kvm to command line

'-enable-kvm' only exists on qemu-kvm-rhel6

Chnage from V1:
 - Use has_option() to check enable-kvm support.

Signed-off-by: Amos Kong <akong@redhat.com>
Signed-off-by: Feng Yang <fyang@redhat.com>
virt.kvm_vm: Add the "menu" options to -boot

This patch adds the "-boot" option instead of using
'extra_params' parameter. There are there new variants
added:
 - boot_order
 - boot_once
 - boot_menu

It's different in different kvm version to use -boot,
so we need to check the usage of the "-boot".

Signed-off-by: slei <slei@redhat.com>
Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
KVM Test: Add support for VNC extra params

This patch also adds get_vnc_port function in VM class

Signed-off-by: Feng Yang <fyang@redhat.com>
Acked-by: Qingtang Zhou <qzhou@redhat.com>
Acked-by: Golita Yue <gyue@redhat.com>
KVM-test: Add family to cpu for whql

WHQL test need add family in cpu options.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
Acked-by: Feng Yang <fyang@redhat.com>
Acked-by: Xiaoqing Wei <xwei@redhat.com>
Acked-by: Qingtang Zhou <qzhou@redhat.com>
KVM Test: Update vm.reboot function

Do not need session when reboot by system_reset.
Test this patch with reboot test case.

Changes from v1:
 - Make this patch works for merged tree.

Signed-off-by: Feng Yang <fyang@redhat.com>
KVM-test: Kill VM more gracefully through monitor

Check the guest status util it changed to paused before timeout,
then send quit to monitor. By this way may ignore some qcow2 image
problems in tests. The parameter kill_vm_in_paused can be set to
"no" if some damage tests. Also make the destroy timeout
configurable.

Changes from V1:
 - Update log message.
 - Put 'kill_timeout' && 'kill_vm_only_when_paused' in config file

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
virt: Move PciAssignable out of virt_utils module

This PciAssignable class depends kvm_control module which will raise
an exception in guest. Thus move this class to virt_test_setup module
so that we can use virt_utils in client tests.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
Acked-by: Yiqiao Pu <ypu@redhat.com>
virt: Shorten name of the default HMP monitor

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>