qemu.tests: new case to check guest clock with syscall

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: add timedrift_check_clock_offset cfg

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: add check clock offset when vm crash/bsod

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: add cfg for check clock offset when guest bsod/crash

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: new case to check clock offset after hotplug vcpus

check guest clock drift less that $acceptable_offset after online/offline
hotpluged vcpus;

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: cfg for checking clock offset after hotplug vcpu

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: check kvm-clock using newer msr set

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: cfg for kvm-clock newer msrs support check test

Signed-off-by: Xu Tian <xutian@redhat.com>
virttest: add interface to save lvm object to env file

register lvm object to env file when use lvm storage, and restore it at
postprocess to clean up new volumes when "force_remove_image = yes";
virttest: LVM storage base module

Signed-off-by: Xu Tian <xutian@redhat.com>
virttest: add emulated lvm support

Signed-off-by: Xu Tian <xutian@redhat.com>
virttest: add lvm storage support for qemu tests

Signed-off-by: Xu Tian <xutian@redhat.com>
shared.cfg: add params for supporting lvm partiton

Signed-off-by: Xu Tian <xutian@redhat.com>
virttest.qemu_vm: Log information about the parent PID and the monitor name.

When starting the qemu process, there is not much information about
the running parent PID (the autotest shell script that starts qemu) or
the monitor name that we are trying to connect (for example, hmp1).

So with this commit we're logging this information when qemu is started,
in order to provide information for debugging. Example:

When running  ./run -t qemu --tests=uptime --qemu_sandbox=on

From debug.log:

11:43:17 INFO | Created qemu process with parent PID 15592
11:43:17 INFO | Connecting to monitor 'hmp1'
11:44:17 WARNI| Could not find (qemu) prompt after connecting to monitor. Output so far: ''
11:44:18 ERROR| Could not connect to monitor 'hmp1'
11:44:18 DEBUG| Destroying VM virt-tests-vm1 (PID 15594)

Parent PID is 15592, now we are trying to find what is wrong...

ps -ef | grep 15592
rmoura   15592 15591  0 11:43 pts/3    00:00:00 /bin/bash -c source /tmp/autotestbMRLRL.sh
rmoura   15594 15592  0 11:43 pts/3    00:00:00 [qemu-system-x86] <defunct>

In this situation, it's clear that qemu-system-x86_64 goes bad.

Signed-off-by: Ruda Moura <rmoura@redhat.com>
Merge pull request #1049 from ruda/qemu-vm-monitor-logs

virttest.qemu_vm: Log information about the parent PID and the monitor n...
Merge pull request #908 from xutian/lvm_support

Add lvm support for qemu tests
Merge pull request #974 from xutian/add_timedrift_case

qemu.tests: new case to check guest clock offset
virsh_change_media: Backup and restore original vm xml

* In new_from_dumpxml(), the used keyword argument 'options'
  doesn't exist in virsh.dumpxml(). This must be a typo
  s/options/extra.

* Fix a raise typo and some pylint/pep8 issues.

* The original xml of the vm need to be backed up before test
  and restored after it to keep the xml unchanged.

* When backing up, the xml need to be dumped using '--inactive'
  option. Otherwise the xml backup is slightly different from
  the original one like below. I'm not sure this will cause
  any problem, but it's annoying.

---
+++
@@ -4,6 +4,9 @@
   <memory unit='KiB'>1048576</memory>
   <currentMemory unit='KiB'>1048576</currentMemory>
   <vcpu placement='static'>2</vcpu>
+  <resource>
+    <partition>/machine</partition>
+  </resource>
   <os>
     <type arch='x86_64' machine='pc-i440fx-rhel7.0.0'>hvm</type>
     <boot dev='hd'/>
@@ -43,7 +46,9 @@
     </console>
     <input type='tablet' bus='usb'/>
     <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'/>
@@ -52,4 +57,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>
libvirt: virsh_edit: Add maximum option for vcpucount

* In RHEL-6, vcpucount --config option must be used with --maximum
  or --active option, using only --config option with cause error:

  > virsh vcpucount virt-tests-vm1 --config
  error: when using --config, either --maximum or --active must
  be specified

* The vm need to backup with '--inactive' option to avoid xml
  inconsistence.

* No need to disable pylint E1111

* Fix some pylint/pep8 problem.

Signed-off-by: Hao Liu <hliu@redhat.com>
libvirt_vm: Add method to create install cmd with sec_label

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>