Skip to content

Commit

Permalink
Update the expectation for libvirt_guests
Browse files Browse the repository at this point in the history
If there is no "on_boot" setting in libvirt_guests.conf, the behavior
will be the same with "on_boot=start" for running VM. Refer to
libvirt.org: "By default, libvirt-guests will suspend running
guests when the host shuts down, and restore them to their pre-shutdown
state when the host reboots."

Signed-off-by: Yalan Zhang <[email protected]>
  • Loading branch information
yalzhang committed Dec 13, 2024
1 parent 98a2acd commit ee03832
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ def chk_on_boot(status_error, on_boot):
:param status_error: positive test if status_error is "no", otherwise
negative test
:param on_boot: action taking on host booting
:param on_boot: action taking on host booting which set in the conf file
"""
if status_error == "no":
if on_boot == "start" or transient_vm:
for dom in vms:
if on_boot != "ignore":
for dom in active_vms:
if not dom.is_alive():
test.fail("guest:%s should be running after "
"restarting libvirt-guests." % dom.name)
Expand Down Expand Up @@ -353,6 +353,11 @@ def transfer_to_transient(per_guest_name):
process.run("cat /etc/sysconfig/libvirt-guests", shell=True)

tail_messages = get_log()
# Before restart libvirt-guests, check the status of all VMs
active_vms = []
for dom in vms:
if dom.is_alive:
active_vms.append(dom)
# Even though libvirt-guests was designed to operate guests when
# host shutdown. The purpose can also be fulfilled by restart the
# libvirt-guests service.
Expand Down

0 comments on commit ee03832

Please sign in to comment.