autotest/virt-test — pull request #594 by yangdongsheng (2013-07-03 08:53:07+00:00)
Title: virt_vm: Fix get_address failed bug in virt_vm.

Hi guys:
There is a scene where virt_vm.get_address will fail.

Example:
(1). vm exists and there is a dump of it in env file.
(2). sometimes we need to change the nic device of vm.
(3). vm.get_address will down.
Because get_address will use the mac stored in env
to search ip. Obviously, this ip and mac is outdated.

This patchset will fix this bug, by replacing get_address with wait_for_get_address.
If we get an error in waiting, we will do a update_mac_address and go on.
So get_address will success in the next loop.

But, the update_mac_address is only for vm_type=libvirt, because I can not
get the current mac from a qemu process. So there is a TODO comment in update_mac_address.

BTW, although the update_mac_address is TODO for qemu vm, qemu guys need no worry about using
wait_for_get_address. It will return get_address directly if the update_mac_address is not implemented for you.
So you can use wait_for_get_address safely and waiting for the TODO.