Add a new runqemu field for VGA devices.  Currently, these are being set
in QB_OPT_APPEND, which can make them difficult to override if importing
the config file into another one.

Signed-off-by: Jon Mason <[email protected]>
Change-Id: I8cb9527954c5b06c083c42fe2466cb3338584b7d
---
 meta/classes/qemuboot.bbclass               | 4 ++++
 meta/conf/machine/include/qemuboot-mips.inc | 2 +-
 meta/conf/machine/qemuarm.conf              | 4 ++--
 meta/conf/machine/qemuarm64.conf            | 4 ++--
 scripts/runqemu                             | 2 +-
 5 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/meta/classes/qemuboot.bbclass b/meta/classes/qemuboot.bbclass
index 4b7532b3043d..8798ad80e68b 100644
--- a/meta/classes/qemuboot.bbclass
+++ b/meta/classes/qemuboot.bbclass
@@ -72,6 +72,9 @@
 #                      Can be used to automatically determine the image from 
the other variables
 #                      but define things link 'bootindex' when booting from 
EFI or 'readonly' when using squashfs
 #                      without the need to specify a dedicated qemu 
configuration
+#
+# QB_GRAPHICS: QEMU video card type (e.g. "-vga std")
+#
 # Usage:
 # IMAGE_CLASSES += "qemuboot"
 # See "runqemu help" for more info
@@ -86,6 +89,7 @@ QB_NETWORK_DEVICE ?= "-device 
virtio-net-pci,netdev=net0,mac=@MAC@"
 QB_CMDLINE_IP_SLIRP ?= "ip=dhcp"
 QB_CMDLINE_IP_TAP ?= "ip=192.168.7.@CLIENT@::192.168.7.@GATEWAY@:255.255.255.0"
 QB_ROOTFS_EXTRA_OPT ?= ""
+QB_GRAPHICS ?= ""
 
 # This should be kept align with ROOT_VM
 QB_DRIVE_TYPE ?= "/dev/sd"
diff --git a/meta/conf/machine/include/qemuboot-mips.inc 
b/meta/conf/machine/include/qemuboot-mips.inc
index 230f032c5303..4954f3068c9c 100644
--- a/meta/conf/machine/include/qemuboot-mips.inc
+++ b/meta/conf/machine/include/qemuboot-mips.inc
@@ -5,4 +5,4 @@ QB_KERNEL_CMDLINE_APPEND = "console=ttyS0 console=tty"
 QB_OPT_APPEND = "-usb -device usb-tablet"
 
 # For graphics to work we need to define the VGA device as well as the 
necessary USB devices
-QB_OPT_APPEND += "-vga std"
+QB_GRAPHICS = "-vga std"
diff --git a/meta/conf/machine/qemuarm.conf b/meta/conf/machine/qemuarm.conf
index 257cfa3e63ea..37dae8c86353 100644
--- a/meta/conf/machine/qemuarm.conf
+++ b/meta/conf/machine/qemuarm.conf
@@ -19,8 +19,8 @@ QB_CPU = "-cpu cortex-a15"
 # Standard Serial console
 QB_KERNEL_CMDLINE_APPEND = "console=ttyAMA0 vmalloc=256"
 # For graphics to work we need to define the VGA device as well as the 
necessary USB devices
-QB_OPT_APPEND = "-device VGA,edid=on"
-QB_OPT_APPEND += "-device qemu-xhci -device usb-tablet -device usb-kbd"
+QB_GRAPHICS = "-device VGA,edid=on"
+QB_OPT_APPEND = "-device qemu-xhci -device usb-tablet -device usb-kbd"
 # Virtio Networking support
 QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
 QB_NETWORK_DEVICE = "-device virtio-net-device,netdev=net0,mac=@MAC@"
diff --git a/meta/conf/machine/qemuarm64.conf b/meta/conf/machine/qemuarm64.conf
index 2f61eb0aed5f..05fd1f749b0f 100644
--- a/meta/conf/machine/qemuarm64.conf
+++ b/meta/conf/machine/qemuarm64.conf
@@ -20,8 +20,8 @@ QB_CPU_KVM = "-cpu host -machine gic-version=3"
 # Standard Serial console
 QB_KERNEL_CMDLINE_APPEND = "console=ttyAMA0"
 # For graphics to work we need to define the VGA device as well as the 
necessary USB devices
-QB_OPT_APPEND = "-device VGA,edid=on"
-QB_OPT_APPEND += "-device qemu-xhci -device usb-tablet -device usb-kbd"
+QB_GRAPHICS = "-device VGA,edid=on"
+QB_OPT_APPEND = "-device qemu-xhci -device usb-tablet -device usb-kbd"
 # Virtio Networking support
 QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
 QB_NETWORK_DEVICE = "-device virtio-net-device,netdev=net0,mac=@MAC@"
diff --git a/scripts/runqemu b/scripts/runqemu
index cf64ca149c53..4c8358e9de79 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1341,7 +1341,7 @@ class BaseConfig(object):
         if not os.access(qemu_bin, os.X_OK):
             raise OEPathError("No QEMU binary '%s' could be found" % qemu_bin)
 
-        self.qemu_opt = "%s %s %s %s %s" % (qemu_bin, self.get('NETWORK_CMD'), 
self.get('QB_RNG'), self.get('ROOTFS_OPTIONS'), self.get('QB_OPT_APPEND'))
+        self.qemu_opt = "%s %s %s %s %s %s" % (qemu_bin, 
self.get('NETWORK_CMD'), self.get('QB_RNG'), self.get('QB_GRAPHICS'), 
self.get('ROOTFS_OPTIONS'), self.get('QB_OPT_APPEND'))
 
         for ovmf in self.ovmf_bios:
             format = ovmf.rsplit('.', 1)[-1]
-- 
2.20.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#149251): 
https://lists.openembedded.org/g/openembedded-core/message/149251
Mute This Topic: https://lists.openembedded.org/mt/81241092/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to