Improve qemu monitor communication at start

Wait for the monitor to be alive via a no-op command before attempting
to use the monitor for anything functional.

Initial wait time is 30 seconds.
This commit is contained in:
Tom Marshall 2021-06-16 13:39:26 -07:00
parent 50e4397145
commit a1a503d289
1 changed files with 4 additions and 1 deletions

5
vmmd
View File

@ -1021,8 +1021,11 @@ class VirtualMachine(DbObject):
pass
fork_child(argv)
file_wait_exists(self._qemu_pidfile(), 2.0)
res = self._run_monitor_command('info status', 30.0)
if not res:
loge('Failed to communicate with monitor')
if resuming:
self._run_monitor_command('delvm vmm-suspend', 5.0)
self._run_monitor_command('delvm vmm-suspend')
if self['vncpass']:
self._run_monitor_command("change vnc password %s" % (self['vncpass']))