From a2832a5633f66f85843184c223517bdb124104c2 Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Tue, 5 Mar 2019 08:26:17 +0100
Subject: [PATCH 9/9] egl-headless: parse rendernode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Gerd Hoffmann <kraxel@redhat.com>
Message-id: <20190305082617.14614-5-kraxel@redhat.com>
Patchwork-id: 84797
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 4/4] egl-headless: parse rendernode
Bugzilla: 1648236
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
RH-Acked-by: John Snow <jsnow@redhat.com>
RH-Acked-by: Erik Skultety <eskultet@redhat.com>
RHEL-7 hasn't the qapi-based -display parser, so we need a
few lines of code to explicitly handle the new option.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
vl.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/vl.c b/vl.c
index 8b79eb9..dfe261d 100644
--- a/vl.c
+++ b/vl.c
@@ -2202,6 +2202,15 @@ static void parse_display(const char *p)
}
} else if (strstart(p, "egl-headless", &opts)) {
dpy.type = DISPLAY_TYPE_EGL_HEADLESS;
+ if (*opts) {
+ const char *nextopt;
+ if (strstart(opts, ",rendernode=", &nextopt)) {
+ dpy.u.egl_headless.rendernode = strdup(nextopt);
+ } else {
+ error_report("invalid egl-headless option string");
+ exit(1);
+ }
+ }
} else if (strstart(p, "curses", &opts)) {
dpy.type = DISPLAY_TYPE_CURSES;
} else if (strstart(p, "gtk", &opts)) {
--
1.8.3.1