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>
tests: Add a case to install hck client in Windows guest

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
device_bit_check.cfg: replace scsi_extra_params_hda with blk_extra_params

change the parameter name scsi_extra_params_hda to blk_extra_params.

Signed-off-by: Xiangmin Han <xhan@redhat.com>
virsh: Add options in virsh.restore() fucntion.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
libvirt-tests: Use tmp_file for virsh restore

Reported-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
virttest: Destory pre vm in env_process

Destory the pre vm in preprocess_vm. otherwise some strange error
will be produced as some vm object options is different.

Signed-off-by: Yiqiao Pu <ypu@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>
tests.jumbo: Modify cfg of jumbo tests.

For windows guest when using e1000 the max icmp size is not
"jumbopacket - 28", but "jumbopacket - 42", so modify the cfg.

This patch also modify the coding style to up to the pep8.

Signed-off-by: Yunping Zheng <yunzheng@redhat.com>
tests.jumbo: make jumbo test support macvtap

This patch make jumbo test support macvtap. when using macvtap nic,
before chang the mtu of the macvtap, must change the base interface
mtu.

Signed-off-by: Yunping Zheng <yunzheng@redhat.com>
block_resize.cfg: RHEL5 need reboot step in block_resize case

Guest RHEL5 could not detect disk change, assign need_reboot
as yes in the cfg file. And disable RHEL.4 guest.

history:
  V3:
    add no filter for RHEL.4 guest
  V2:
    change to RHEL.5 condition
  V1:
    add RHEL and 5 condition lines

Signed-off-by: Xiangmin Han <xhan@redhat.com>
Unify Windows unattended files

making the cmd num aligned, to avoid miss any tiny cmd in the future.
this patch is done by update win2008(NT6.0) first, then
copied to all other OSes, with necessary modification,
and cmd adjustment:
1) avoid using '/All /LimitAccess' on NT6.1, as do not supported
2) use ocsetup instead of dism on NT6.0, as do not available
3) this patch also resolved some cmd are lost at some OS(timedrift)
4) move enable ahci booting registry modification to
   <FirstLogonCommands> part to Workaround MSFT bug
5) and added explain for some cmds
6) coverted by unix2dos
7) as switched to use name to select install img, now Win 8.1 needs
   it's own unattended_file

Signed-off-by: Xiaoqing Wei <xwei@redhat.com>
Merge pull request #1140 from ypu/restart_vm

virttest: Should destroy pre vm in create()
Merge pull request #1279 from Xiangmin/block_resize_bugfix

block_resize.cfg: RHEL5 need reboot step in block_resize case
Merge pull request #1229 from spcui/timedrift

qemu.tests.timedrift_with_stop: Bug fix about drift
Merge pull request #1185 from humanux/jumbo

tests.jumbo: Modify cfg of jumbo tests.
virttest: increase CMD_TIMEOUT

sometimes, we can not read qmp socket response immedicately if host under
heavy IO load (eg, drive_mirroring to net file system), autotest will raise
error 'Received no response to QMP or Received a incorrect response ID',
increase CMD_TIMEOUT to 120s to avoid this kind of issue;

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: add new case for drive_mirroring test

negative test for cancel mirroring job that blocked by firewall;

Signed-off-by: Xu Tian <xutian@redhat.com>
Merge pull request #1291 from xutian/cancel_mirror_with_firewall

New case to test cancel mirroring job blocked by firewall