@@ -581,7 +581,6 @@ to your build configuration.
self.snapshot = True
elif arg == 'publicvnc':
self.publicvnc = True
- self.qemu_opt_script += ' -vnc :0'
elif arg == 'guestagent':
self.guest_agent = True
elif arg == "qmp":
@@ -1468,15 +1467,22 @@ to your build configuration.
if (self.gl_es == True or self.gl == True) and (self.sdl == False and self.gtk == False):
raise RunQemuError('Option gl/gl-es needs gtk or sdl option.')
+ if self.publicvnc:
+ self.qemu_opt += ' -vnc :0'
+
# If we have no display option, we autodetect based upon what qemu supports. We
# need our font setup and show-cusor below so we need to see what qemu --help says
# is supported so we can pass our correct config in.
if not self.nographic and not self.sdl and not self.gtk and not self.publicvnc and not self.egl_headless == True:
output = subprocess.check_output([self.qemu_bin, "--help"], universal_newlines=True, env=self.qemu_environ)
- if "-display gtk" in output:
+ if "-display gtk" in output and "DISPLAY" in os.environ:
self.gtk = True
- elif "-display sdl" in output:
+ elif "-display sdl" in output and "DISPLAY" in os.environ:
self.sdl = True
+ elif "-display vnc" in output and self.taplock_descriptor:
+ vncaddress = "unix:%s" % self.taplock.replace(".lock", ".vnc-socket")
+ logger.info("Using VNC server at %s for graphical output" % vncaddress)
+ self.qemu_opt += " -vnc %s" % vncaddress
else:
self.qemu_opt += ' -display none'
We would like to be able to fall back on QEMU's internal VNC server when there is no DISPLAY available. Add code to do this, putting a socket for VNC alongside the network interface tap lock files. This won't work if tap networking isn't enabled but in most of our use cases it will be and it avoids having to invent a new location for the sockets. If there are needs outside this, that can be addressed in future. Also move the other "publicvnc" code to be alongside the rest of the graphics parameters for ease of reading the code. The publicvnc option doesn't work for this use case as it can't handle multiple concurrent qemu istances. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> --- scripts/runqemu | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)