[libvirt PATCH v4 02/11] conf: add <graphics type='dbus'>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>

Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
---
 src/conf/domain_conf.c                        | 78 ++++++++++++++++++-
 src/conf/domain_conf.h                        |  8 ++
 src/conf/domain_validate.c                    |  9 ++-
 src/conf/schemas/basictypes.rng               |  7 ++
 src/conf/schemas/domaincommon.rng             | 33 ++++++++
 src/libxl/libxl_conf.c                        |  1 +
 src/libxl/libxl_domain.c                      |  1 +
 src/libxl/libxl_driver.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_7.0.0-q35.x86_64.xml  |  1 +
 .../domaincapsdata/qemu_7.0.0-tcg.x86_64.xml  |  1 +
 tests/domaincapsdata/qemu_7.0.0.x86_64.xml    |  1 +
 .../domaincapsdata/qemu_7.1.0-q35.x86_64.xml  |  1 +
 .../domaincapsdata/qemu_7.1.0-tcg.x86_64.xml  |  1 +
 tests/domaincapsdata/qemu_7.1.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 +++
 29 files changed, 272 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/src/conf/domain_conf.c b/src/conf/domain_conf.c
index d9b55c80aa..eb56974fbe 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -926,6 +926,7 @@ VIR_ENUM_IMPL(virDomainGraphics,
               "desktop",
               "spice",
               "egl-headless",
+              "dbus",
 );
 
 VIR_ENUM_IMPL(virDomainGraphicsListen,
@@ -1919,6 +1920,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;
     }
@@ -12773,6 +12779,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)
 {
@@ -12845,6 +12884,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;
     }
@@ -26594,6 +26637,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;
     }
@@ -31320,6 +31384,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;
         }
@@ -31335,7 +31404,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;
@@ -31354,6 +31424,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:
@@ -31375,6 +31448,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 2e2da0c69c..025ed55169 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1777,6 +1777,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;
@@ -1953,6 +1954,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 18eb8d697d..ba474ee8c0 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -2424,8 +2424,15 @@ virDomainGraphicsDefValidate(const virDomainDef *def,
             return -1;
     }
 
-    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/conf/schemas/basictypes.rng b/src/conf/schemas/basictypes.rng
index a221ff6295..ae4d568222 100644
--- a/src/conf/schemas/basictypes.rng
+++ b/src/conf/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/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng
index 2544864eb4..14b5955cad 100644
--- a/src/conf/schemas/domaincommon.rng
+++ b/src/conf/schemas/domaincommon.rng
@@ -4037,6 +4037,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/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index e5fe209718..f0f7dfaa07 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -1537,6 +1537,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/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index dbe44f4ffc..af938192a9 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -957,6 +957,7 @@ libxlDomainCleanup(libxlDriverPrivate *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;
         }
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 9ffa20161d..d4ae875854 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -465,6 +465,7 @@ libxlReconnectDomain(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_capabilities.c b/src/qemu/qemu_capabilities.c
index 5134f44aa2..ce3e7d275a 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -6226,6 +6226,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 8eac8edd79..7a9ea6ae41 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -8620,6 +8620,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:
@@ -10244,6 +10245,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 4d4be0683a..806de9f4b0 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3676,6 +3676,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 702fd0239c..ad6faf503c 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15714,12 +15714,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:
@@ -15782,12 +15783,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 274f47c25d..791d4e446a 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -4420,6 +4420,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 fd4db43a42..4924f8ea0b 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4708,6 +4708,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;
     }
@@ -4747,6 +4748,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;
     }
@@ -4903,6 +4905,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;
     }
@@ -5195,6 +5198,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 6ff61d91fa..5a437562c2 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -4254,6 +4254,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 8150bbfaa9..c391caa910 100644
--- a/src/vmx/vmx.c
+++ b/src/vmx/vmx.c
@@ -3435,6 +3435,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_7.0.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml
index 1f56616587..4e6ff06125 100644
--- a/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml
+++ b/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml
@@ -155,6 +155,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_7.0.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml
index 9ed9123f7d..ed80a7892f 100644
--- a/tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml
+++ b/tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml
@@ -169,6 +169,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_7.0.0.x86_64.xml b/tests/domaincapsdata/qemu_7.0.0.x86_64.xml
index 71532ad0ed..a20395c6d4 100644
--- a/tests/domaincapsdata/qemu_7.0.0.x86_64.xml
+++ b/tests/domaincapsdata/qemu_7.0.0.x86_64.xml
@@ -155,6 +155,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_7.1.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml
index b6bb9e3ffe..c1df755463 100644
--- a/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml
+++ b/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml
@@ -155,6 +155,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_7.1.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml
index cd14a10f05..9cb254cac6 100644
--- a/tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml
+++ b/tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml
@@ -169,6 +169,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_7.1.0.x86_64.xml b/tests/domaincapsdata/qemu_7.1.0.x86_64.xml
index 58bce4251e..dcadb1c279 100644
--- a/tests/domaincapsdata/qemu_7.1.0.x86_64.xml
+++ b/tests/domaincapsdata/qemu_7.1.0.x86_64.xml
@@ -155,6 +155,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 0000000000..1e8526b274
--- /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 0000000000..a99e695471
--- /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 0000000000..be8442b3cd
--- /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 0000000000..c2ff4590c1
--- /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 0000000000..8f705412b3
--- /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 0000000000..e52af445d9
--- /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 8b655874d1..6578a80213 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -400,6 +400,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.36.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux