On Thu, Nov 29, 2018 at 03:20:18PM +0100, Erik Skultety wrote:
Just like for SPICE, we need to put the DRI device into the
namespace,
otherwise it will be left out from the DAC relabeling process.
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
src/qemu/qemu_domain.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index ee61caa823..dd4f77193a 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -11866,14 +11866,9 @@ qemuDomainSetupGraphics(virQEMUDriverConfigPtr cfg
ATTRIBUTE_UNUSED,
virDomainGraphicsDefPtr gfx,
const struct qemuDomainCreateDeviceData *data)
{
- const char *rendernode = gfx->data.spice.rendernode;
+ const char *rendernode = virDomainGraphicsGetRenderNode(gfx);
- if (gfx->type != VIR_DOMAIN_GRAPHICS_TYPE_SPICE ||
- gfx->data.spice.gl != VIR_TRISTATE_BOOL_YES ||
- !rendernode)
- return 0;
I think:
if (!rendernode)
return 0;
is more readable than using ?:
-
- return qemuDomainCreateDevice(rendernode, data, false);
+ return !rendernode ? 0 : qemuDomainCreateDevice(rendernode, data, false);
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Jano