PciAssignable: Make nic_name_re configurable.

nic_name_re used to filter nic name in host.

Signed-off-by: Feng Yang <fyang@redhat.com>
PciAssignable: Do not modprobe it, if self.driver is not available.

Signed-off-by: Feng Yang <fyang@redhat.com>
virttest: Handle AttributeError exception in store_vm_register() function.

We may got following error when monitor not ready:
07/05 13:11:07 ERROR| threading:0545|   File "/usr/lib64/python2.6/threading.py", line 532, in __bootstrap_inner
07/05 13:11:07 ERROR| threading:0545|     self.run()
07/05 13:11:07 ERROR| threading:0545|   File "/usr/lib64/python2.6/threading.py", line 484, in run
07/05 13:11:07 ERROR| threading:0545|     self.__target(*self.__args, **self.__kwargs)
07/05 13:11:07 ERROR| threading:0545|   File "/usr/local/staf/test/RHEV/kvm/autotest-devel/client/tests/virt/virttest/env_process.py", line 1092, in _store_vm_register
07/05 13:11:07 ERROR| threading:0545|     stored_log = store_vm_register(vm, vr_filename)
07/05 13:11:07 ERROR| threading:0545|   File "/usr/local/staf/test/RHEV/kvm/autotest-devel/client/tests/virt/virttest/env_process.py", line 1052, in store_vm_register
07/05 13:11:07 ERROR| threading:0545|     output = vm.monitor.info('registers', debug=False)
07/05 13:11:07 ERROR| threading:0545| AttributeError: 'NoneType' object has no attribute 'info'

Signed-off-by: Feng Yang <fyang@redhat.com>
virttest.env_process: Use vm.instance in counter and vm_register_error_count in _store_vm_register()

Now we use vm.name in  counter and vm_register_error_count in _store_vm_register().
It could not work well in migration mode, which two vms have same name.

Signed-off-by: Feng Yang <fyang@redhat.com>
virttest.libvirt_vm: Add function to get libvirt job's type.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
shared.scripts: Add a tool for setting 0 to memory.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
virttest.utils_netperf: Support multi package size in NetperfClient.(bg_)start()

Signed-off-by: Feng Yang <fyang@redhat.com>
virt.virttest.utils_test.update_boot_option: Check kernel option at the end of function.

Signed-off-by: Feng Yang <fyang@redhat.com>
vm_xml: convert 'current' vcpu value to int

The definition type of 'current' vcpu is string, so need convert it
before compare it with an int value.

Signed-off-by: Yanbing Du <ydu@redhat.com>
virttest: Update the kernel command line update part of code in env_process

As the original code for msi setup and extra_kernel_params setup are both
update the guest kernel command line. So remove some duplicate code. And
add the kernel command line restore code in post_process to restore the default
kernel command line in guest. Also add kernel command line check if guest is
started in preprocess.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
virttest.qemu_storage: Update create() function when using qcow2 format

Some option only support qcow2 format, like: preallocation, encryption,
cluster_size.

Signed-off-by: Shuping Cui <scui@redhat.com>
virttest.qemu_storage: Fix a typo

We use 'encryption=on' for qcow2 format now.

Signed-off-by: Shuping Cui <scui@redhat.com>
Add methods to get host/VM cpu topolopy

1. Add accessors for cpu_topolopy in capability xml.
2. Add three func for libvirt VM to get domian cpu topolopy from
different ways.

Signed-off-by: Yanbing Du <ydu@redhat.com>
utils_test: Support disk format for creating image of RemoteDiskManager.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
utils_test.libvirt: Make sure XML file has been created for create_disk_xml.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
utils_test.libvirt: Support multiple disks and scsi disks for attach_disks.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
virttest.utils_test.libvirt: Add export_options in pre_pool params

Add support setup netfs with export options like 'root_squash' other
than default 'no_root_squash'.

Signed-off-by: Wayne Sun <gsun@redhat.com>
utils_test.libvirt: Fix exportfs cleanup problem with netfs pool

The nfs exportfs did not clean up after run, it caused by export_dir
not specified when use cleanup_pool.

Signed-off-by: Wayne Sun <gsun@redhat.com>
libvirt_xml: update CPUXML and capabilityXML

Commit 393d19fa update class CPUXML without update related methods
of it, so fix it. And create a new func to do feature number check.

Signed-off-by: Yanbing Du <ydu@redhat.com>
virt-test: Replace the line break of info numa with "\n"

In different version of qemu, the output of info numa is different.
So we need replace the line break with "\n" so the pattern can
actually work.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>