From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: [PULL 4/6] hw/display: fail early when multiple virgl devices are requested
Date: Fri, 23 Jul 2021 07:54:46 +0200 [thread overview]
Message-ID: <20210723055448.1032115-5-kraxel@redhat.com> (raw)
In-Reply-To: <20210723055448.1032115-1-kraxel@redhat.com>
From: Marc-André Lureau <marcandre.lureau@redhat.com>
This avoids failing to initialize virgl and crashing later on, and clear
the user expectations.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20210705104218.1161101-1-marcandre.lureau@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/display/virtio-gpu-gl.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c
index 7ab93bf8c829..b1035e119c3b 100644
--- a/hw/display/virtio-gpu-gl.c
+++ b/hw/display/virtio-gpu-gl.c
@@ -113,6 +113,11 @@ static void virtio_gpu_gl_device_realize(DeviceState *qdev, Error **errp)
return;
#endif
+ if (!object_resolve_path_type("", TYPE_VIRTIO_GPU_GL, NULL)) {
+ error_setg(errp, "at most one %s device is permitted", TYPE_VIRTIO_GPU_GL);
+ return;
+ }
+
if (!display_opengl) {
error_setg(errp, "opengl is not available");
return;
--
2.31.1
next prev parent reply other threads:[~2021-07-23 5:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-23 5:54 [PULL 0/6] Vga 20210723 patches Gerd Hoffmann
2021-07-23 5:54 ` [PULL 1/6] hw/display/virtio-gpu: Fix memory leak (CID 1453811) Gerd Hoffmann
2021-07-23 5:54 ` [PULL 2/6] qxl: remove assert in qxl_pre_save Gerd Hoffmann
2021-07-23 5:54 ` [PULL 3/6] Revert "qxl: add migration blocker to avoid pre-save assert" Gerd Hoffmann
2021-07-23 5:54 ` Gerd Hoffmann [this message]
2021-07-23 5:54 ` [PULL 5/6] vl: add virtio-vga-gl to the default_list Gerd Hoffmann
2021-07-23 5:54 ` [PULL 6/6] hw/display: fix virgl reset regression Gerd Hoffmann
2021-07-23 14:26 ` [PULL 0/6] Vga 20210723 patches Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210723055448.1032115-5-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).