From: Marc-André Lureau <marcandre.lureau(a)redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau(a)redhat.com>
---
docs/schemas/basictypes.rng | 7 ++
docs/schemas/domaincommon.rng | 33 ++++++++
src/conf/domain_conf.c | 78 ++++++++++++++++++-
src/conf/domain_conf.h | 8 ++
src/conf/domain_validate.c | 9 ++-
src/libxl/libxl_conf.c | 1 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_command.c | 2 +
src/qemu/qemu_domain.c | 1 +
src/qemu/qemu_driver.c | 6 +-
src/qemu/qemu_hotplug.c | 1 +
src/qemu/qemu_process.c | 4 +
src/qemu/qemu_validate.c | 1 +
src/vmx/vmx.c | 1 +
.../domaincapsdata/qemu_6.2.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_6.2.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_6.2.0.x86_64.xml | 1 +
.../graphics-dbus-address.xml | 35 +++++++++
tests/qemuxml2argvdata/graphics-dbus-p2p.xml | 33 ++++++++
tests/qemuxml2argvdata/graphics-dbus.xml | 33 ++++++++
.../graphics-dbus-address.xml | 1 +
.../qemuxml2xmloutdata/graphics-dbus-p2p.xml | 1 +
tests/qemuxml2xmloutdata/graphics-dbus.xml | 1 +
tests/qemuxml2xmltest.c | 10 +++
24 files changed, 267 insertions(+), 4 deletions(-)
create mode 100644 tests/qemuxml2argvdata/graphics-dbus-address.xml
create mode 100644 tests/qemuxml2argvdata/graphics-dbus-p2p.xml
create mode 100644 tests/qemuxml2argvdata/graphics-dbus.xml
create mode 120000 tests/qemuxml2xmloutdata/graphics-dbus-address.xml
create mode 120000 tests/qemuxml2xmloutdata/graphics-dbus-p2p.xml
create mode 120000 tests/qemuxml2xmloutdata/graphics-dbus.xml
diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng
index a221ff6295c0..ae4d5682229c 100644
--- a/docs/schemas/basictypes.rng
+++ b/docs/schemas/basictypes.rng
@@ -220,6 +220,13 @@
</define>
<!--======================================================================-->
+ <!-- A D-Bus server address:
https://dbus.freedesktop.org/doc/dbus-specification.html#addresses -->
+ <define name="dbusAddr">
+ <data type="string">
+ <param name="pattern">.+</param>
+ </data>
+ </define>
+
<!-- An ipv4 "dotted quad" address -->
<define name="ipv4Addr">
<data type="string">
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index f01b7a64704b..1dba199db7ec 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -3996,6 +3996,39 @@
</optional>
</interleave>
</group>
+ <group>
+ <attribute name="type">
+ <value>dbus</value>
+ </attribute>
+ <optional>
+ <choice>
+ <group>
+ <attribute name="address">
+ <ref name="dbusAddr"/>
+ </attribute>
+ </group>
+ <group>
+ <attribute name="p2p">
+ <ref name="virYesNo"/>
+ </attribute>
+ </group>
+ </choice>
+ </optional>
+ <interleave>
+ <optional>
+ <element name="gl">
+ <attribute name="enable">
+ <ref name="virYesNo"/>
+ </attribute>
+ <optional>
+ <attribute name="rendernode">
+ <ref name="absFilePath"/>
+ </attribute>
+ </optional>
+ </element>
+ </optional>
+ </interleave>
+ </group>
<group>
<attribute name="type">
<value>rdp</value>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index bdcc3dc2c12f..11eb1422d8c1 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -911,6 +911,7 @@ VIR_ENUM_IMPL(virDomainGraphics,
"desktop",
"spice",
"egl-headless",
+ "dbus",
);
VIR_ENUM_IMPL(virDomainGraphicsListen,
@@ -1891,6 +1892,11 @@ void virDomainGraphicsDefFree(virDomainGraphicsDef *def)
g_free(def->data.egl_headless.rendernode);
break;
+ case VIR_DOMAIN_GRAPHICS_TYPE_DBUS:
+ g_free(def->data.dbus.address);
+ g_free(def->data.dbus.rendernode);
+ break;
+
case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
break;
}
@@ -12866,6 +12872,39 @@ virDomainGraphicsDefParseXMLEGLHeadless(virDomainGraphicsDef
*def,
}
+static int
+virDomainGraphicsDefParseXMLDBus(virDomainGraphicsDef *def,
+ xmlNodePtr node,
+ xmlXPathContextPtr ctxt)
+{
+ VIR_XPATH_NODE_AUTORESTORE(ctxt)
+ xmlNodePtr cur;
+ virTristateBool p2p;
+
+ if (virXMLPropTristateBool(node, "p2p", VIR_XML_PROP_NONE,
+ &p2p) < 0)
+ return -1;
+ def->data.dbus.p2p = p2p == VIR_TRISTATE_BOOL_YES;
+
+ def->data.dbus.address = virXMLPropString(node, "address");
+ def->data.dbus.fromConfig = def->data.dbus.address != NULL;
+
+ ctxt->node = node;
+
+ if ((cur = virXPathNode("./gl", ctxt))) {
+ def->data.dbus.rendernode = virXMLPropString(cur,
+ "rendernode");
+
+ if (virXMLPropTristateBool(cur, "enable",
+ VIR_XML_PROP_REQUIRED,
+ &def->data.dbus.gl) < 0)
+ return -1;
+ }
+
+ return 0;
+}
+
+
virDomainGraphicsDef *
virDomainGraphicsDefNew(virDomainXMLOption *xmlopt)
{
@@ -12940,6 +12979,10 @@ virDomainGraphicsDefParseXML(virDomainXMLOption *xmlopt,
case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS:
virDomainGraphicsDefParseXMLEGLHeadless(def, node, ctxt);
break;
+ case VIR_DOMAIN_GRAPHICS_TYPE_DBUS:
+ if (virDomainGraphicsDefParseXMLDBus(def, node, ctxt) < 0)
+ goto error;
+ break;
case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
break;
}
@@ -26622,6 +26665,27 @@ virDomainGraphicsDefFormat(virBuffer *buf,
def->data.egl_headless.rendernode);
virBufferAddLit(buf, "/>\n");
break;
+ case VIR_DOMAIN_GRAPHICS_TYPE_DBUS:
+ if (def->data.dbus.p2p)
+ virBufferAddLit(buf, " p2p='yes'");
+ if (def->data.dbus.address)
+ virBufferAsprintf(buf, " address='%s'",
+ def->data.dbus.address);
+
+ if (!def->data.dbus.gl)
+ break;
+
+ if (!children) {
+ virBufferAddLit(buf, ">\n");
+ virBufferAdjustIndent(buf, 2);
+ children = true;
+ }
+
+ virBufferAsprintf(buf, "<gl enable='%s'",
+ virTristateBoolTypeToString(def->data.dbus.gl));
+ virBufferEscapeString(buf, " rendernode='%s'",
def->data.dbus.rendernode);
+ virBufferAddLit(buf, "/>\n");
+ break;
case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
break;
}
@@ -31336,6 +31400,11 @@ virDomainGraphicsDefHasOpenGL(const virDomainDef *def)
case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS:
return true;
+ case VIR_DOMAIN_GRAPHICS_TYPE_DBUS:
+ if (graphics->data.dbus.gl == VIR_TRISTATE_BOOL_YES)
+ return true;
+
+ continue;
case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
break;
}
@@ -31351,7 +31420,8 @@ virDomainGraphicsSupportsRenderNode(const virDomainGraphicsDef
*graphics)
bool ret = false;
if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE ||
- graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS)
+ graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS ||
+ graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_DBUS)
ret = true;
return ret;
@@ -31370,6 +31440,9 @@ virDomainGraphicsGetRenderNode(const virDomainGraphicsDef
*graphics)
case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS:
ret = graphics->data.egl_headless.rendernode;
break;
+ case VIR_DOMAIN_GRAPHICS_TYPE_DBUS:
+ ret = graphics->data.dbus.rendernode;
+ break;
case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
@@ -31391,6 +31464,9 @@ virDomainGraphicsNeedsAutoRenderNode(const virDomainGraphicsDef
*graphics)
if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE &&
graphics->data.spice.gl != VIR_TRISTATE_BOOL_YES)
return false;
+ if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_DBUS &&
+ graphics->data.dbus.gl != VIR_TRISTATE_BOOL_YES)
+ return false;
if (virDomainGraphicsGetRenderNode(graphics))
return false;
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index c0c07ea6ba24..384b85db3a2c 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1733,6 +1733,7 @@ typedef enum {
VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP,
VIR_DOMAIN_GRAPHICS_TYPE_SPICE,
VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS,
+ VIR_DOMAIN_GRAPHICS_TYPE_DBUS,
VIR_DOMAIN_GRAPHICS_TYPE_LAST
} virDomainGraphicsType;
@@ -1916,6 +1917,13 @@ struct _virDomainGraphicsDef {
struct {
char *rendernode;
} egl_headless;
+ struct {
+ bool p2p;
+ char *address;
+ char *rendernode;
+ virTristateBool gl;
+ bool fromConfig; /* true if the @address is config file originated */
+ } dbus;
} data;
/* nListens, listens, and *port are only useful if type is vnc,
* rdp, or spice. They've been extracted from the union only to
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index a4271f12479f..c13472516fec 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -2240,8 +2240,15 @@ static int
virDomainGraphicsDefValidate(const virDomainDef *def,
const virDomainGraphicsDef *graphics)
{
- if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC)
+ if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
return virDomainEnsureAudioID(def, graphics->data.vnc.audioId);
+ } else if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_DBUS) {
+ if (graphics->data.dbus.p2p && graphics->data.dbus.address) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("D-Bus p2p with an address is not supported"));
+ return -1;
+ }
+ }
return 0;
}
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index f37c2281390b..398f29ad3257 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -1551,6 +1551,7 @@ libxlMakeVfb(virPortAllocatorRange *graphicsports,
case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS:
+ case VIR_DOMAIN_GRAPHICS_TYPE_DBUS:
case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
break;
}
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 495f7171da1c..12d3ca8c903d 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -6081,6 +6081,8 @@ virQEMUCapsFillDomainDeviceGraphicsCaps(virQEMUCaps *qemuCaps,
VIR_DOMAIN_CAPS_ENUM_SET(dev->type, VIR_DOMAIN_GRAPHICS_TYPE_SPICE);
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_EGL_HEADLESS))
VIR_DOMAIN_CAPS_ENUM_SET(dev->type, VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS);
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DISPLAY_DBUS))
+ VIR_DOMAIN_CAPS_ENUM_SET(dev->type, VIR_DOMAIN_GRAPHICS_TYPE_DBUS);
}
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index c47998aabdf1..0fb55fc94365 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -8672,6 +8672,7 @@ qemuBuildGraphicsCommandLine(virQEMUDriverConfig *cfg,
graphics) < 0)
return -1;
+ case VIR_DOMAIN_GRAPHICS_TYPE_DBUS:
break;
case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
@@ -10444,6 +10445,7 @@ qemuBuildCommandLineValidate(virQEMUDriver *driver,
case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS:
++egl_headless;
break;
+ case VIR_DOMAIN_GRAPHICS_TYPE_DBUS:
case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 2c10f185f86c..32cb1d8713d5 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3453,6 +3453,7 @@ qemuDomainDefSuggestDefaultAudioBackend(virQEMUDriver *driver,
case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS:
+ case VIR_DOMAIN_GRAPHICS_TYPE_DBUS:
break;
case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
default:
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index b88fb470323a..006b893b80bf 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15668,12 +15668,13 @@ qemuDomainOpenGraphics(virDomainPtr dom,
case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
protocol = "spice";
break;
+ case VIR_DOMAIN_GRAPHICS_TYPE_DBUS:
case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Can only open VNC or SPICE graphics backends, not
%s"),
+ _("Can only open VNC, SPICE or D-Bus p2p graphics backends,
not %s"),
virDomainGraphicsTypeToString(vm->def->graphics[idx]->type));
goto endjob;
case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
@@ -15736,12 +15737,13 @@ qemuDomainOpenGraphicsFD(virDomainPtr dom,
case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
protocol = "spice";
break;
+ case VIR_DOMAIN_GRAPHICS_TYPE_DBUS:
case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Can only open VNC or SPICE graphics backends, not
%s"),
+ _("Can only open VNC, SPICE or D-Bus p2p graphics backends,
not %s"),
virDomainGraphicsTypeToString(vm->def->graphics[idx]->type));
goto cleanup;
case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 71c068619042..421ead96ecd5 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -4378,6 +4378,7 @@ qemuDomainChangeGraphics(virQEMUDriver *driver,
case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS:
+ case VIR_DOMAIN_GRAPHICS_TYPE_DBUS:
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to change config on '%s' graphics
type"), type);
break;
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 6b83a571b916..53b5dcaff5d7 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4782,6 +4782,7 @@ qemuProcessGraphicsReservePorts(virDomainGraphicsDef *graphics,
case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS:
+ case VIR_DOMAIN_GRAPHICS_TYPE_DBUS:
case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
break;
}
@@ -4821,6 +4822,7 @@ qemuProcessGraphicsAllocatePorts(virQEMUDriver *driver,
case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS:
+ case VIR_DOMAIN_GRAPHICS_TYPE_DBUS:
case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
break;
}
@@ -4977,6 +4979,7 @@ qemuProcessGraphicsSetupListen(virQEMUDriver *driver,
case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS:
+ case VIR_DOMAIN_GRAPHICS_TYPE_DBUS:
case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
break;
}
@@ -5281,6 +5284,7 @@ qemuProcessStartValidateGraphics(virDomainObj *vm)
case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS:
+ case VIR_DOMAIN_GRAPHICS_TYPE_DBUS:
case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
break;
}
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index 1de6e0510128..05792f4e4c0a 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -4170,6 +4170,7 @@ qemuValidateDomainDeviceDefGraphics(const virDomainGraphicsDef
*graphics,
case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
+ case VIR_DOMAIN_GRAPHICS_TYPE_DBUS:
case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
break;
}
diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
index d3540acd84a8..2c48bbc5e812 100644
--- a/src/vmx/vmx.c
+++ b/src/vmx/vmx.c
@@ -3446,6 +3446,7 @@ virVMXFormatConfig(virVMXContext *ctx, virDomainXMLOption *xmlopt,
virDomainDef
case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS:
+ case VIR_DOMAIN_GRAPHICS_TYPE_DBUS:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported graphics type '%s'"),
virDomainGraphicsTypeToString(def->graphics[i]->type));
diff --git a/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml
b/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml
index 9d68c0a404bb..303378e3e1fb 100644
--- a/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml
+++ b/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml
@@ -154,6 +154,7 @@
<value>vnc</value>
<value>spice</value>
<value>egl-headless</value>
+ <value>dbus</value>
</enum>
</graphics>
<video supported='yes'>
diff --git a/tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml
b/tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml
index 8db840faac9e..04b5f72e0dde 100644
--- a/tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml
+++ b/tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml
@@ -160,6 +160,7 @@
<value>vnc</value>
<value>spice</value>
<value>egl-headless</value>
+ <value>dbus</value>
</enum>
</graphics>
<video supported='yes'>
diff --git a/tests/domaincapsdata/qemu_6.2.0.x86_64.xml
b/tests/domaincapsdata/qemu_6.2.0.x86_64.xml
index 0f89790b60e2..a946f96b1db0 100644
--- a/tests/domaincapsdata/qemu_6.2.0.x86_64.xml
+++ b/tests/domaincapsdata/qemu_6.2.0.x86_64.xml
@@ -154,6 +154,7 @@
<value>vnc</value>
<value>spice</value>
<value>egl-headless</value>
+ <value>dbus</value>
</enum>
</graphics>
<video supported='yes'>
diff --git a/tests/qemuxml2argvdata/graphics-dbus-address.xml
b/tests/qemuxml2argvdata/graphics-dbus-address.xml
new file mode 100644
index 000000000000..1e8526b2748e
--- /dev/null
+++ b/tests/qemuxml2argvdata/graphics-dbus-address.xml
@@ -0,0 +1,35 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i386</emulator>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <graphics type='dbus' address='unix:path=/tmp/foo'>
+ <gl enable='yes' rendernode='/dev/dri/foo'/>
+ </graphics>
+ <video>
+ <model type='cirrus' vram='16384' heads='1'
primary='yes'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x02' function='0x0'/>
+ </video>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/graphics-dbus-p2p.xml
b/tests/qemuxml2argvdata/graphics-dbus-p2p.xml
new file mode 100644
index 000000000000..a99e695471cb
--- /dev/null
+++ b/tests/qemuxml2argvdata/graphics-dbus-p2p.xml
@@ -0,0 +1,33 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i386</emulator>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <graphics type='dbus' p2p='yes'/>
+ <video>
+ <model type='cirrus' vram='16384' heads='1'
primary='yes'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x02' function='0x0'/>
+ </video>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/graphics-dbus.xml
b/tests/qemuxml2argvdata/graphics-dbus.xml
new file mode 100644
index 000000000000..be8442b3cdb3
--- /dev/null
+++ b/tests/qemuxml2argvdata/graphics-dbus.xml
@@ -0,0 +1,33 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i386</emulator>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <graphics type='dbus'/>
+ <video>
+ <model type='cirrus' vram='16384' heads='1'
primary='yes'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x02' function='0x0'/>
+ </video>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/graphics-dbus-address.xml
b/tests/qemuxml2xmloutdata/graphics-dbus-address.xml
new file mode 120000
index 000000000000..c2ff4590c161
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/graphics-dbus-address.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/graphics-dbus-address.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/graphics-dbus-p2p.xml
b/tests/qemuxml2xmloutdata/graphics-dbus-p2p.xml
new file mode 120000
index 000000000000..8f705412b30b
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/graphics-dbus-p2p.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/graphics-dbus-p2p.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/graphics-dbus.xml
b/tests/qemuxml2xmloutdata/graphics-dbus.xml
new file mode 120000
index 000000000000..e52af445d941
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/graphics-dbus.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/graphics-dbus.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index b535cda1879f..ba891df0dfb6 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -373,6 +373,16 @@ mymain(void)
QEMU_CAPS_VNC,
QEMU_CAPS_EGL_HEADLESS);
+ DO_TEST("graphics-dbus",
+ QEMU_CAPS_DEVICE_CIRRUS_VGA,
+ QEMU_CAPS_DISPLAY_DBUS);
+ DO_TEST("graphics-dbus-address",
+ QEMU_CAPS_DEVICE_CIRRUS_VGA,
+ QEMU_CAPS_DISPLAY_DBUS);
+ DO_TEST("graphics-dbus-p2p",
+ QEMU_CAPS_DEVICE_CIRRUS_VGA,
+ QEMU_CAPS_DISPLAY_DBUS);
+
DO_TEST_CAPS_ARCH_LATEST("default-video-type-aarch64",
"aarch64");
DO_TEST_CAPS_ARCH_LATEST("default-video-type-ppc64", "ppc64");
DO_TEST_CAPS_ARCH_LATEST("default-video-type-riscv64",
"riscv64");
--
2.34.1.8.g35151cf07204