virttest.qemu_vm: Remove init_pci_addr from VM.

Now vm.init_pci_addr is effected by previous vm.

We set init_pci_addr to 3 in multi_disk.max_disk, but this case still
fail for:
VMPCIOutOfRangeError: Too many PCI devices added on vm 'virt-tests-vm1',
 max supported '31'

because previous case use default value 4.

As init_pci_addr only used in get_free_pci_addr, so remove it from vm
 and only get init_pci_addr in get_free_pci_addr().
Also set default for init_pci_addr to 3.

Signed-off-by: Feng Yang <fyang@redhat.com>
qemu.control.kernel-version: Bug fix for control.kernel-version

This patch fix three problems in control.kernel-version:
  - Fix the wrong variable name.
  - Remove the parse_file inside control file for host-kernel.cfg
    Just in clude it as other cfg files in your tests-example.cfg
    which is more flexible. And this also can work with the situation
    that without host-kernel.cfg.
  - Don't get the package version if there is no need for package
    version check.

Also add some docstring for how to use the package filter.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
KVM Test: Add qmp_command test.

This script have coverd following qmp command:
query-hpet, query-kvm, query-mice, query-status
query-name, query-uuid, query-version, query-chardev
query-blockstats, memsave, pmemsave, query-cpus
cpu, query-vnc, query-block, query-commands
query-balloon, balloon, cont, stop
and a negative test with wrong command.

This script will check result by following way:
cmd_result_check = equal, will compare cmd_return_value with qmp command output.
cmd_result_check = contain, will try to find cmd_return_value in qmp command output.
cmd_result_check = m_equal_q, will compare key value in monitor command output and qmp command output.
cmd_result_check = m_in_q, will try to find monitor command output's key value in qmp command output.
cmd_result_check = post_contain, will try to find cmd_return_value in post command output.

This update is base on upstream QMP patchset.

Changes from v1:
Bug fix and update according to ldoktor's comment

Signed-off-by: Feng Yang <fyang@redhat.com>
KVM-test: Add format check for qmp_command test
Signed-off-by: Yiqiao Pu <ypu@redhat.com>
qemu.tests.cfg: Add config for qmp_command.py test script.

Signed-off-by: Feng Yang <fyang@redhat.com>
qemu.tests: Make qmp_command suitable for more host

List some case only Host_RHEL.6
Do not run these case in RHEL3, RHEL4 guest.
Reconfig qmp_query-mice test case.
Rename qmp_device_add to qmp_redhat_device_add.
Re-design qmp_command.qmp_query-version test case

Signed-off-by: Feng Yang <fyang@redhat.com>
to add nodememstats function
to add configuration file for virsh nodememstats testcase
to add testcase file for virsh nodememstats command
qemu.tests.cpu_hotplug: Fix timeout issue and typo fix

Test may timeout when check guest's cpu after hotplug.
Update the timeout = 60 + total_cpus.

Update the log message when max cpu reached.
Set autotest case timeout to 2000s in add_max_cpu subcase.
run_autotest always timeout in add_max_cpu case.

Signed-off-by: Feng Yang <fyang@redhat.com>
Some fix for dummy_virsh in libvirt_xml_unittest.

(1).add a define method for dummy_virsh.
(2).some small fix to make pylint calm down.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
Add getter and setter of seclabel into vm_xml module.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
Add seclabel related unittest into libvirt_xml_unittest

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
Add utils_selinux in virttest.

changes from v1:
(1).use getfattr to replace ls -Z
(2).use /proc//attr/current to replace ps -Z
(3).remove some error type seems unnecssary.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
Add unittest for utils_selinux.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
virttest: Fix pylint complaint of selinux module.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
Merge pull request #446 from FengYang/qmp_command

Add qmp_command test case.
virt: Added GithubIssues tool/module/class and example

Signed-off-by: Chris Evich <cevich@redhat.com>
virt: Improve github_issues and examples

* Be less pedantic about re-formatting already cached data
* Added 'url' key to standardized issue format
* Added two useful sample report scripts

Signed-off-by: Chris Evich <cevich@redhat.com>
virttest.build_helper: Add remote origin and submodule init

Add the proper origin, and fetch submodules for git repos,
that'll make it possible to build QEMU with spice support
from source.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
qemu/cfg/build.cfg: Remove qemu-kvm and add spice-common repos

QEMU-KVM is no more, and spice was split in spice common and
protocol, so let's update the build.cfg file with that
information.

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