virsh-domif-setlink-getlink: add backup and restore of vm xml config

We need to backup and restore the guest xml config because we are
modifying the guest. If we don't do this, every other test will fail
because we break the network and the guest is not reachable by
ssh client.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
virttest/qemu_monitor.py: Allow '=' in parameter string for HMP

Parse code of monitor command parameters did not handle '='
signs in parameter itself i.e.:
cert-subject="C=CZ/L=BRNO/O=SPICE/CN=server".
This is already implemeted for QMP.

Signed-off-by: Marian Krcmarik <mkrcmari@redhat.com>
libvirt: Supoort libvirt pool xml accessor

Signed-off-by: Yanbing Du <ydu@redhat.com>
libvirt: Add test for virsh pool-create command

Signed-off-by: Yanbing Du <ydu@redhat.com>
qemu.tests: update block mirroring/streaming cfg

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: enhance drive_mirror class

if no event check, it sleep 3 seconds to wait job in steady status
really;

Signed-off-by: Xu Tian <xutian@redhat.com>
virttest.virsh: Add nodedev-{create, destroy} commands wrapper function

Signed-off-by: Alex Jia <ajia@redhat.com>
virttest.libvirt_xml.nodedev_xml: Add new elements and attribute

Signed-off-by: Alex Jia <ajia@redhat.com>
libvirt.tests: Add test cases for virsh nodedev-{create, destroy}

Signed-off-by: Alex Jia <ajia@redhat.com>
virttest.libvirt_xml.vm_xml: Add support of change current vcpu

Support change current vcpu in set_vm_vcpus method, add new
current_vcpu XMLAttribute in VMXMLBase.

This will benefit vcpu hotplug for setting current vcpu first.

Signed-off-by: Wayne Sun <gsun@redhat.com>
libvirt.tests: Add virsh vcpucount test

The test works for domain state as "shut off" or "running", it check
vcpucount result after vcpu hotplug using setvcpus.

For setvcpus, include four valid options:
  --config
  --config --maximum
  --live
  --guest

For vcpucount options, restrict up to 2 options together, upstream libvirt
support more options combinations now (e.g. 3 options together or single
--maximum option), for backward support, only following options are
checked:
  None
  --config --active
  --config --maximum
  --live --active
  --live --maximum
  --current --active
  --current --maximum
  --guest

Signed-off-by: Wayne Sun <gsun@redhat.com>
timedrift.cfg: change the ntp, date variants

Change the ntp, date variants to share the same with_load.
And add full_load variant for with_load.
Signed-off-by: Xiangmin Han <xhan@redhat.com>
virt: Remove useless wrap of at-detach disk.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
virttest.utils_libguestfs: Add functions for Guestfish

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
libguestfs.tests: Add testcases for guestfish partition operations.

Prepare: Attach a new disk to guest, and assign to vdb.
Testcases: Operate vdb with partition operations: part-*.
Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
tests.timedrift: Make all variants explicit

And remove variants with default in their name. We do
have new cartesian features that can make us get away
with naming variants 'default', but for now, let's
play safe and use more unique variant names.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.standalone_test: return when pressing "q" in list view

When using --list-tests, the test list is piped to
something that can handle it (usually, the unix command
'less'). If one quits less, using the shortcut 'q',
an IOError is raised.

Let's handle this more gracefully, making the function
tied to --list-tests to return when an IOError is raised.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt: Codespell fixes + extra newline

Signed-off-by: Chris Evich <cevich@redhat.com>
Merge pull request 883 & codespell fixes

Libguestfs.tests:Test guestfish partition operations
virt-libirt: Fix two unittest failures

* When __init__ is called by the accessors.XMLElementNest factory
  the super() builtin has trouble referencing the class definition.

* Rather than a more complicated fix, I made these two cases just
  reference 'self.__class__' instead, which should remain correct
  since we shouldn't need to subclass those classes ever.

Signed-off-by: Chris Evich <cevich@redhat.com>