diff --git a/shared/cfg/base.cfg b/shared/cfg/base.cfg index 87578f40b5a..223e672cb0a 100644 --- a/shared/cfg/base.cfg +++ b/shared/cfg/base.cfg @@ -120,6 +120,10 @@ q35, arm64-pci, arm64-mmio: # serials = "S1 S2 S3" serials = "serial0" +# Enable this to "yes" if you want to force wait_for_login +# to give serial session incase of failure +force_use_serial_login = "no" + # virtio_serialport and virtio_console ports # virtio_ports = "vs1 vs2 vc1" # Port types diff --git a/virttest/virt_vm.py b/virttest/virt_vm.py index 5f18ed9a856..957ae9e10a4 100644 --- a/virttest/virt_vm.py +++ b/virttest/virt_vm.py @@ -1149,6 +1149,8 @@ def print_guest_network_info(): session.close() error = None + if not serial: + serial = self.params.get("force_use_serial_login", "no") == "yes" logging.debug("Attempting to log into '%s' (timeout %ds)", self.name, timeout) start_time = time.time()