mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 13:09:50 +00:00
runqemu: add an option to enable guest-agent virtio device
Add support to the runqemu script for a new option, 'guestagent', that enables the virtio serial port for host-to-guest communication. (From OE-Core rev: 21a1e52079089c5bbeee8ffc9c504471f4a8732a) Signed-off-by: Brenda Streiff <brenda.streiff@ni.com> Signed-off-by: Clément Péron <peron.clem@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
1c01cbaed5
commit
1f6b7ec6a4
@@ -82,6 +82,7 @@ of the following environment variables (in any order):
|
|||||||
kvm-vhost - enable KVM with vhost when running x86/x86_64 (VT-capable CPU required)
|
kvm-vhost - enable KVM with vhost when running x86/x86_64 (VT-capable CPU required)
|
||||||
publicvnc - enable a VNC server open to all hosts
|
publicvnc - enable a VNC server open to all hosts
|
||||||
audio - enable audio
|
audio - enable audio
|
||||||
|
guestagent - enable guest agent communication
|
||||||
[*/]ovmf* - OVMF firmware file or base name for booting with UEFI
|
[*/]ovmf* - OVMF firmware file or base name for booting with UEFI
|
||||||
tcpserial=<port> - specify tcp serial port number
|
tcpserial=<port> - specify tcp serial port number
|
||||||
qemuparams=<xyz> - specify custom parameters to QEMU
|
qemuparams=<xyz> - specify custom parameters to QEMU
|
||||||
@@ -216,6 +217,8 @@ class BaseConfig(object):
|
|||||||
self.cleaned = False
|
self.cleaned = False
|
||||||
# Files to cleanup after run
|
# Files to cleanup after run
|
||||||
self.cleanup_files = []
|
self.cleanup_files = []
|
||||||
|
self.guest_agent = False
|
||||||
|
self.guest_agent_sockpath = '/tmp/qga.sock'
|
||||||
|
|
||||||
def acquire_taplock(self, error=True):
|
def acquire_taplock(self, error=True):
|
||||||
logger.debug("Acquiring lockfile %s..." % self.taplock)
|
logger.debug("Acquiring lockfile %s..." % self.taplock)
|
||||||
@@ -526,6 +529,10 @@ class BaseConfig(object):
|
|||||||
elif arg == 'publicvnc':
|
elif arg == 'publicvnc':
|
||||||
self.publicvnc = True
|
self.publicvnc = True
|
||||||
self.qemu_opt_script += ' -vnc :0'
|
self.qemu_opt_script += ' -vnc :0'
|
||||||
|
elif arg == 'guestagent':
|
||||||
|
self.guest_agent = True
|
||||||
|
elif arg.startswith('guestagent-sockpath='):
|
||||||
|
self.guest_agent_sockpath = '%s' % arg[len('guestagent-sockpath='):]
|
||||||
elif arg.startswith('tcpserial='):
|
elif arg.startswith('tcpserial='):
|
||||||
self.tcpserial_portnum = '%s' % arg[len('tcpserial='):]
|
self.tcpserial_portnum = '%s' % arg[len('tcpserial='):]
|
||||||
elif arg.startswith('qemuparams='):
|
elif arg.startswith('qemuparams='):
|
||||||
@@ -1375,6 +1382,12 @@ class BaseConfig(object):
|
|||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
raise RunQemuError("/dev/dri directory does not exist; no render nodes available on this machine. %s" %(render_hint))
|
raise RunQemuError("/dev/dri directory does not exist; no render nodes available on this machine. %s" %(render_hint))
|
||||||
|
|
||||||
|
def setup_guest_agent(self):
|
||||||
|
if self.guest_agent == True:
|
||||||
|
self.qemu_opt += ' -chardev socket,path=' + self.guest_agent_sockpath + ',server,nowait,id=qga0 '
|
||||||
|
self.qemu_opt += ' -device virtio-serial '
|
||||||
|
self.qemu_opt += ' -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0 '
|
||||||
|
|
||||||
def setup_vga(self):
|
def setup_vga(self):
|
||||||
if self.nographic == True:
|
if self.nographic == True:
|
||||||
if self.sdl == True:
|
if self.sdl == True:
|
||||||
@@ -1506,6 +1519,7 @@ class BaseConfig(object):
|
|||||||
if self.snapshot:
|
if self.snapshot:
|
||||||
self.qemu_opt += " -snapshot"
|
self.qemu_opt += " -snapshot"
|
||||||
|
|
||||||
|
self.setup_guest_agent()
|
||||||
self.setup_serial()
|
self.setup_serial()
|
||||||
self.setup_vga()
|
self.setup_vga()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user