On Sun, 31 May 2020 at 07:27, Philippe Mathieu-Daudé <phi...@redhat.com> wrote: > > On 5/29/20 10:34 PM, Robert Foley wrote: <snip> > > @@ -271,7 +276,9 @@ class BaseVM(object): > > args += self._data_args + extra_args + self._config['extra_args'] > > logging.debug("QEMU args: %s", " ".join(args)) > > qemu_path = get_qemu_path(self.arch, self._build_path) > > - guest = QEMUMachine(binary=qemu_path, args=args) > > + guest = QEMUMachine(binary=qemu_path, args=args, > > + console_log=self._console_log_path, > > + drain_console=True) > > Are you sure you need to set drain_console here? Isn't it implied by > self._console_log_path?
Good point. Yes, drain_console is implied by self._console_log_path. Will fix it. Thanks & Regards, -Rob > > > guest.set_machine(self._config['machine']) > > guest.set_console() > > try: > > @@ -285,6 +292,8 @@ class BaseVM(object): > > raise > > atexit.register(self.shutdown) > > self._guest = guest > > + # Init console so we can start consuming the chars. > > + self.console_init() > > usernet_info = guest.qmp("human-monitor-command", > > command_line="info usernet") > > self.ssh_port = None > > @@ -296,7 +305,9 @@ class BaseVM(object): > > raise Exception("Cannot find ssh port from 'info > > usernet':\n%s" % \ > > usernet_info) > > > > - def console_init(self, timeout = 120): > > + def console_init(self, timeout = None): > > + if timeout == None: > > + timeout = self.socket_timeout > > vm = self._guest > > vm.console_socket.settimeout(timeout) > > self.console_raw_path = os.path.join(vm._temp_dir, > > @@ -578,6 +589,8 @@ def parse_args(vmcls): > > parser.add_option("--efi-aarch64", > > default="/usr/share/qemu-efi-aarch64/QEMU_EFI.fd", > > help="Path to efi image for aarch64 VMs.") > > + parser.add_option("--log-console", action="store_true", > > + help="Log console to file.") > > parser.disable_interspersed_args() > > return parser.parse_args() > > > > >