6 files changed, 37 insertions(+)
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index 976746e292..7fe8b03a56 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -7103,6 +7103,14 @@ A video device.
sub-element is valid for model types "vga", "qxl", "bochs", "gop",
and "virtio".
+ :since:`Since 11.7.0` (QEMU driver only), the ``model`` element may have an
+ optional ``edid`` attribute that can be set to "on" or "off". If the
``edid``
+ attribute is not specified then the device will use its default value.
+ Otherwise setting ``edid`` to "on" will expose the device EDID blob to the
+ guest, whilst setting it to "off" will hide the device EDID blob from the
+ guest. The ``edid`` attribute is only valid for model types "vga", "bochs",
+ and "virtio".
+
``acceleration``
Configure if video acceleration should be enabled.
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 59958c2f08..10cc6d7432 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -13535,6 +13535,9 @@ virDomainVideoModelDefParseXML(virDomainVideoDef *def,
if (virXMLPropTristateSwitch(node, "blob", VIR_XML_PROP_NONE, &def->blob)
< 0)
return -1;
+ if (virXMLPropTristateSwitch(node, "edid", VIR_XML_PROP_NONE, &def->edid) < 0)
+ return -1;
+
return 0;
}
@@ -26629,6 +26632,8 @@ virDomainVideoDefFormat(virBuffer *buf,
virBufferAddLit(buf, " primary='yes'");
if (def->blob != VIR_TRISTATE_SWITCH_ABSENT)
virBufferAsprintf(buf, " blob='%s'",
virTristateSwitchTypeToString(def->blob));
+ if (def->edid != VIR_TRISTATE_SWITCH_ABSENT)
+ virBufferAsprintf(buf, " edid='%s'",
virTristateSwitchTypeToString(def->edid));
if (def->accel || def->res) {
virBufferAddLit(buf, ">\n");
virBufferAdjustIndent(buf, 2);
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 596d138973..425ccfa97c 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1895,6 +1895,7 @@ struct _virDomainVideoDef {
virDomainDeviceInfo info;
virDomainVirtioOptions *virtio;
virDomainVideoBackendType backend;
+ virTristateSwitch edid;
};
/* graphics console modes */
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index 40edecef83..60a2e46b7e 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -231,6 +231,17 @@ virDomainVideoDefValidate(const virDomainVideoDef *video,
}
}
+ if ((video->type != VIR_DOMAIN_VIDEO_TYPE_BOCHS) &&
+ (video->type != VIR_DOMAIN_VIDEO_TYPE_VGA) &&
+ (video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO)) {
+ if (video->edid != VIR_TRISTATE_SWITCH_ABSENT) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("video type '%1$s' does not support edid"),
+ virDomainVideoTypeToString(video->type));
+ return -1;
+ }
+ }
+
return 0;
}
diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng
index a714c3fcc5..d84f20637c 100644
--- a/src/conf/schemas/domaincommon.rng
+++ b/src/conf/schemas/domaincommon.rng
@@ -4807,6 +4807,11 @@
<ref name="virOnOff"/>
</attribute>
</optional>
+ <optional>
+ <attribute name="edid">
+ <ref name="virOnOff"/>
+ </attribute>
+ </optional>
<optional>
<element name="acceleration">
<optional>
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 457dee7029..db00f9b173 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4739,6 +4739,13 @@ qemuBuildDeviceVideoCmd(virCommand *cmd,
return -1;
}
+ if ((video->type == VIR_DOMAIN_VIDEO_TYPE_BOCHS) ||
+ (video->type == VIR_DOMAIN_VIDEO_TYPE_VGA) ||
+ (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO)) {