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>
virsh.emulatorpin: fix the way we get a cgroup path

There is a proper method in virttest.staging.utils_cgroup called
"resolve_task_cgroup_path" which is the best way to resolve
a cgroup path for current vm and cgroup controller.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
virt: Fix filesystem type in mtab don't have to be same like fs in mount cmd

example:
   mount -t glusterfs server1:/vol_test /tmp/gmount-dMZ4hf

   cat mtab
     server1:/vol_test /tmp/gmount-dMZ4hf fuse.glusterfs rw,...

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Allows get_net_if filter interfaces by state.

Adds possibility to filter network interface with
if_state == state (UP, DOWN, ...).

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Fix import error when AUTOTEST_PATH is relative and work dir is changed.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Adds support for filesystem backend to storage.

backend could be glusterfs, nfs, ...
Only gluster fs implemented now.
Necessary for gluster testing.
virt: gluster split create and get path functionality.

It should be possible get gluster volume path without create
gluster volume.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Adds support for qcow2 backing file.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Adds support for check disk in storage with native support (gluster).

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: env_preprocess adds support for image backend.

Gluster and iSCSI storage are special because it is supported
native in qemu-kvm different way from other storage backend.

-drive gluster://server1:0/vol_test/f19-64.qcow2
-drive iscsi://<target-ip>[:<port>]/<target-iqn>/<lun>

other backends are firstly connected to system filesystem and
then used through the file path in VM like normal file or
uses other method like p9.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Change config files to use image_backend config.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Adds some gluster tests.

Tests:
1) boot_snap_boot.
2) gluster image create test.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
Merge pull request #1158 from humanux/e1000_regex

share.cfg.guest-os.Windows.cfg : Modify the regex of e1000 Description
virttest.aexpect: Do not remove the aexpect dir wholesale

On double .close(), we'll get to a point where there's an
aexpect instance, but its parent directory was already
nuked. This will cause the .close() method to try to open
a log file in a path where the parent directory doesn't
exist anymore.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Merge pull request #1168 from autotest/aexpect-fix

virttest.aexpect: Do not remove the aexpect dir wholesale
virsh_domfstrim: Check for existence of lsscsi first

Need to check if the 'lsscsi' command exists before running; otherwise,
scsi_disk variable cannot be populated leading to failure to run the
fdisk command that follows.
virsh_vcpucount: Adjust --guest option testing

Couple of issues here. First there was no check to see if the
guest agent was running in the guest. The test would fail as
written with:

stderr: error: argument unsupported: QEMU guest agent is not configured

So borrow from virsh_snapshot_create_as.py and add code to check
and start the guest agent.

Even though the guest agent was running, the underlying QEMU may not
support the 'guest-get-vcpus' option as it was only added as of 1.5.
The error message received is:

 stderr: error: internal error: unable to execute QEMU agent command
  'guest-get-vcpus': The command guest-get-vcpus has not been found

So as a secondary fix - add a check for the stderr check and exit with
SKIP rather than FAIL.

The call to make this check is wrapped inside a try/except so that if
there is a failure, the test can reset the environment back to how it
found it.

Use that reset environment method in other test exit paths as well...

Finally fixed a spelling error in the CFG file from "opiton" to "option"