提交 876c8b3b 编写于 作者: D Daniel P. Berrange

Default console target type with no <target> element

When no <target> element was set at all, the default console
target type was not being honoured

* src/conf/domain_conf.c: Set default target type for consoles
  with no <target>
上级 0f31f7b7
......@@ -3997,6 +3997,7 @@ virDomainChrDefParseXML(virCapsPtr caps,
const char *nodeName;
virDomainChrDefPtr def;
int remaining;
bool seenTarget = false;
if (!(def = virDomainChrDefNew()))
return NULL;
......@@ -4026,6 +4027,7 @@ virDomainChrDefParseXML(virCapsPtr caps,
while (cur != NULL) {
if (cur->type == XML_ELEMENT_NODE) {
if (xmlStrEqual(cur->name, BAD_CAST "target")) {
seenTarget = true;
if (virDomainChrDefParseTargetXML(caps, def, cur) < 0) {
goto error;
}
......@@ -4035,6 +4037,10 @@ virDomainChrDefParseXML(virCapsPtr caps,
}
}
if (!seenTarget &&
((def->targetType = virDomainChrDefaultTargetType(caps, def->deviceType)) < 0))
goto cleanup;
if (def->source.type == VIR_DOMAIN_CHR_TYPE_SPICEVMC) {
if (def->targetType != VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO) {
virDomainReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册