Skip to content

Commit 17fe910

Browse files
committed
qemu: Make boot process configurable
1 parent a9b4ea0 commit 17fe910

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

lib/qemu.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def __init__(self, machine):
3030
self.drive = None
3131
self.initrd = None
3232
self.compat_rootfs = False
33+
self.boot_func = None
3334
self.shutdown = None
3435
self.callback = None
3536
self.extra_args = []
@@ -191,6 +192,12 @@ def apply_defaults(self):
191192

192193
self.extra_args += [rng]
193194

195+
if self.boot_func is None:
196+
def boot(p, timeout, qconf):
197+
standard_boot(p, qconf.login, qconf.user, qconf.password, timeout)
198+
199+
self.boot_func = boot
200+
194201

195202
def cmd(self):
196203
logging.info('Using qemu version %s.%s "%s"' % get_qemu_version(self.qemu_path))
@@ -381,7 +388,7 @@ def qemu_main(qconf):
381388
p.spawn(cmd, logfile=open(qconf.logpath, 'w'), timeout=pexpect_timeout, quiet=qconf.quiet)
382389

383390
p.push_prompt(qconf.prompt)
384-
standard_boot(p, qconf.login, qconf.user, qconf.password, boot_timeout)
391+
qconf.boot_func(p, boot_timeout, qconf)
385392

386393
p.send('echo "booted-revision: `uname -r`"')
387394
p.expect(f'booted-revision: {qconf.expected_release}')

0 commit comments

Comments
 (0)