virt-install: Check --transient status in domain --wait

Otherwise when the VM shuts down, we will report an error, because
the VM doesn't exist anymore. The check_domain_inactive() helper
already handles this case, we just weren't using it in the --wait loop.

https://bugzilla.redhat.com/show_bug.cgi?id=1785643

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2019-12-22 18:03:19 -05:00
parent d52c9d1ffa
commit 6bec5474db

View File

@ -727,7 +727,6 @@ def check_domain(installer, domain, conscb, transient, waithandler):
try:
dominfo = domain.info()
state = dominfo[0]
log.debug("Domain state after install: %s", state)
if state == libvirt.VIR_DOMAIN_CRASHED:
fail(_("Domain has crashed.")) # pragma: no cover
@ -769,7 +768,7 @@ def check_domain(installer, domain, conscb, transient, waithandler):
# Wait loop
while True:
if not domain.isActive(): # pragma: no cover
if check_domain_inactive():
print_stdout(_("Domain has shutdown. Continuing."))
break