def restore_vm0_networking(ovirt_prefix):
# Networking may not work after resume. We need this pseudo-test for the
# purpose of reviving VM networking by rebooting the VM. We must be
# careful to reboot just the guest OS, not to restart the whole VM, to keep
# checking for contingent failures after resume.
# A better solution might be using a guest OS other than Cirros.
if _ping(ovirt_prefix, VM0_PING_DEST) == EX_OK:
return
host = _vm_host(ovirt_prefix, VM0_NAME)
uri = 'qemu+tls://%s/system' % host.name()
ret = host.ssh(['virsh', '-c', uri, 'reboot', '--mode', 'acpi', VM0_NAME])
nt.assert_equals(ret.code, EX_OK)
# We might want to wait until ssh server inside the VM gets up. But the
# interim tests, especially *_recovery, and repeated ssh connection
# attempts in host.ssh calls should give enough time.
评论列表
文章目录