utils_net: raise a right error for bring down interface

Signed-off-by: Yanbing Du <ydu@redhat.com>
utils_test.libvirt: Fix a regex

In some case, interface may has no MAC address:
$virsh iface-list
Name                 State      MAC Address
--------------------------------------------
brlo                 inactive
eth0                 active     44:37:e6:4a:42:d1

So fix the regex to get empty MAC address.

Signed-off-by: Yanbing Du <ydu@redhat.com>
Modify secret-list and add net-update wrapper

1. Variable options is added twice in secret-list and keep the code
style simple and consistent with other APIs

2. Add net_update() API to support libvirt testcase virsh_net_update.py
virttest.qemu_vm: Fix setting qemu dst binary for gzip migration

Turns out our qemu migration dst code is being ignored
when the migration protocol is exec gzip. Let's fix that
by setting the dst before the branch that rules out said
type of migration.

CC: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Merge pull request #1675 from autotest/fix-qemu-dst-setting

virttest.qemu_vm: Fix setting qemu dst binary for gzip migration
Merge pull request #1626 from kylazhang/virsh-command

Modify secret-list and add net-update wrapper
virttest: fix compatibility with python2.4.

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

virttest: fix compatibility with python2.4.
libvirt_vm: Fix wrong option --uri with -c.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Merge pull request #1680 from yangdongsheng/libvirt_vm

libvirt_vm: Fix wrong option --uri with -c.
env_process: Check if VM exists when preprocessing

Before this patch when running test cases without a main VM exists,
say `virt-tests-vm1`, the test still goes on, it will raise a `TestFail`
if it tries to start the non-exist VM or if test was configured not to be
started at the preprocess progress, there will be strange outputs.

This patch check the existence of target VM, and raise a `TestError` if
`main_vm` don't exist or a `TestNAError` if a non-`main_vm` don't exist.

Signed-off-by: Hao Liu <hliu@redhat.com>
Merge pull request #1621 from will-Do/net_fix

Fix two  interface related problems
libvirt_vm: make normalize_connect_uri return exact uri rather than None when input is default.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
libvirt_vm: Fix for vm.connect_uri when it is default.

Default is not always qemu.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
libvirt_vm: introduce two method to VM named is_lxc() and is_qemu().

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
libvirt_vm: Make destroy() support lxc.

If the vm is lxc container, we destroy it with virsh command
rather than send a shutdown into it.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
libvirt_vm: Override wait_for_login() method in libvirt_vm.

Override the wait_for_login method of virt_vm to support other
guest in libvirt.

If connect_uri is lxc related, we call wait_for_serial_login()
directly, without attampting login it via network.

Other connect_uri, call virt_vm.wait_for_login().

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
libvirt_vm: send ^] to serial_console when vm is lxc to close console.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
virttest.utils_libguestfs: Add some PV commands
Merge pull request #1672 from yangdongsheng/lxc_1

[Part 1] Some patches for lxc supporting.