libvirt.tests.virsh_memtune: Replace incompatible py 2.4 construct

The keyword 'with' is valid only on py >= 2.5. We'll have
to wait a bit before those can be freely used.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
libvirt.virsh_schedinfo_qemu_posix: Remove py 2.4 incompatible construct

With is valid only on py >= 2.5. We'll have to wait
a bit until it can be used in virt-test code.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.utils_cgroup_unittest: Make it compatible with python 2.4

This unittest relied on a new param of the tempfile.NamedTemporaryFile
class: delete. Python 2.4 doesn't have such param, which means that
named temp files will always be deleted after they are closed.

So let's use the module only to give us a file path, that will then
be manually managed.

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

Fix py24 bugs
Merge pull request #1264 from Hao-Liu/fix_start

libvirt: Fix start uuid change
qemu.tests.virtual_nic_send_buffer: Update the way used to checkout md5 in guest

md5 command in guest may have different output format. It is a little difficult to
filter out the md5 value from the output. So just checkout whether correct md5 value
is in the output is enough.

Signed-off-by: Feng Yang <fyang@redhat.com>
tests.mac_change: Support file transfer test after mac changing

Signed-off-by: Feng Yang <fyang@redhat.com>
qemu.cfg.device_assignment: Add new device_assignment sub case configure.

Signed-off-by: Feng Yang <fyang@redhat.com>
share.cfg.guest-os: Limit pf_mac_change test case on guest.

pf_mac_change case could not work on WinXP.
Set change_cmd parameter for Windows/Linux guest.

Signed-off-by: Feng Yang <fyang@redhat.com>
qemu.tests.pci_hotunplug: Support sub test before/after unplugging.

Signed-off-by: Feng Yang <fyang@redhat.com>
qemu.tests: Bug fix about drift for timedrift_with_stop

kvm guests CLOCK_MONOTONIC not count when guest is paused,
so drift need to subtract stop_time.

starting from Win2012 Windows no longer relies on number of
injected RTC interrupts for time keeping, and the time drift
is seen because "stop" monitor command also stops PM timer,
so this is unsupported scenario from Win2012 and disabled this
case from Win2012.

changes from v1:
    add some comments for windows guest.
changes from v2:
    add check rtc_clock for windows
changes from v3:
    add new scenario rtc_clock = host and rtc_clock = vm for this case.

Signed-off-by: Shuping Cui <scui@redhat.com>
qemu.tests: bug fix for timedrift_with_cpu_offline

add stop_time after set cpu offline, and update "smp_min" to "smp"
in config file.

changes from v1:
    drift_threshold type fix

Signed-off-by: Shuping Cui <scui@redhat.com>
Merge pull request #1265 from Hao-Liu/fix_setmaxmem

libvirt: Fix setmaxmem from changing mem size
qemu.tests: Add pf hotplug test case.

Signed-off-by: Feng Yang <fyang@redhat.com>
Merge pull request #1287 from Hao-Liu/fix_attach_device

libvirt: Fix attach-device itertools backports
Merge pull request #1290 from FengYang/virtual_nic_send_buffer

qemu.tests.virtual_nic_send_buffer: Update the way used to checkout md5 ...
Add test for snapshot current and parent

Signed-off-by: Kyla Zhang <weizhan@redhat.com>
virttest: Support get VF from specified sr-iov PF.

We can set device_name to PF's devname in host.

If PF not specified, will try to get VF from all PF in turn.

Signed-off-by: Feng Yang <fyang@redhat.com>
sr-iov: virttest.test_setup: Try to get more pxception when VF/Pf clean up command fail.

Also delete self.dev_unbind_drivers.

Signed-off-by: Feng Yang <fyang@redhat.com>
virttest.test_setup: Add devices parameter for get_pf_devs() and get_vf_devs()

Signed-off-by: Feng Yang <fyang@redhat.com>