libguestfs: Add testcases for error_test of guestfs_add.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
libguestfs.test: Fix guestfs_add for new libguestfs version.

In new libguestfs version, all disks will be recognised with /dev/sdx.
But virtio disks of vm will be /dev/vdx in vm.So change gotten
/dev/sdx in guestfish to /dev/vdx if it is necessary.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
libvirt.tests: Support multiple devices for multifunction test.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
libvirt.tests: Add testcases for single_device of multifunction.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
libvirt.tests: Add testcases for multi_devices in multifunction.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
qemu.tests: update max_memory to keep guest from oom in ksm_base

As the scripts will use some extra memory in guest. So include that when
calculate the max memory can be used for test.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
qemu.tests: Remove unreadable codes from linux console in seabios

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
virttest: Record command output for compare_image in qemu_storage

Record the compare command in debug file for further analyse.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
qemu.tests.cfg: Make floppy_test support Windows guests

As already have the command for Window guests in guest-os cfg files,
remove the only Linux in floppy_test.cfg. And the mount_dir is
a parameter only for Linux guest. So remove the force requirement
for the parameter.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
libvirt: Add virsh net-info command test

New testcase: virsh_net_info.py/cfg
virttest.virsh: virsh net-info function
net_info(network, extra="", **dargs)
virttest.env_process: Tcpdump is stopped too early

Tcpdump is required to get ARP ip when calling wait_for_login.
Stopping it before wait_for_login will make wait_for_login hang for 240s

Signed-off-by: Hao Liu <hliu@redhat.com>
libvirt-tests: Backup inactive domain XML

* Added option to toggle saving active or inactive domain XML for
  libvirt_vm.backup_xml

* Added '--inactive' option when dumping xml for backup when calling
  virsh.dumpxml or libvirt_vm.backup_xml. Without this option, the new
  domain restored will change its inactive xml like following diff permanently.

* using vmXML.new_from_inactive_xml instead of vmXML.new_from_xml to
  backup domain.

```diff
@@ -41,7 +41,9 @@
       <target type='serial' port='0'/>
     </console>
     <input type='mouse' bus='ps2'/>
-    <graphics type='vnc' port='-1' autoport='yes'/>
+    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1'>
+      <listen type='address' address='127.0.0.1'/>
+    </graphics>
     <video>
       <model type='cirrus' vram='9216' heads='1'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x02'
function='0x0'/>
@@ -50,4 +52,5 @@
       <address type='pci' domain='0x0000' bus='0x00' slot='0x05'
function='0x0'/>
     </memballoon>
   </devices>
+  <seclabel type='dynamic' model='selinux' relabel='yes'/>
 </domain>
```

Signed-off-by: Hao Liu <hliu@redhat.com>
virt:Fix a hidden bug in virt_filesystems

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
virt:Add a function to get primary disk filesystem type

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
qemu.tests: add enable s3/s4 params for qemu_guest_agent.cfg

since miss the enable s3/s4 params when create the qemu-kvm command
for qemu_guest_agent..check_suspend test.

Signed-off-by: Shuping Cui <scui@redhat.com>
virttest.utils_test.__init__: Add detail error log in get_time()

Also PEP8 fixes in get_time function

Signed-off-by: Feng Yang <fyang@redhat.com>
shared.cfg.guest-hw: Add raw_dd variant.

This variant test raw image which created by dd command.

Signed-off-by: Feng Yang <fyang@redhat.com>
qemu.cfg.virtual_nic_send_buffer: Update configure for netperf_udp sub case.

We change to use netperf under shard/deps folder by default in netperf_udp.
So update virtual_nic_send_buffer.

Signed-off-by: Feng Yang <fyang@redhat.com>
qemu.cfg.host-kernel: Set nettype to bridge when vhost used

vhost only works nettype = bridge

Signed-off-by: Feng Yang <fyang@redhat.com>
qemu.tests: Add flags for add_flag test

Some flags need to be added depends on the host type for the add_flag
test of boot_cpu_model.

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