提交 a4ba59ff 编写于 作者: P Pavel Hrdina

conf: separate PTY chardev source parsing

There is no reason why to share the same code for PTY and other file
based chardev source types.
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
上级 9b341bbf
......@@ -11129,14 +11129,16 @@ virDomainChrSourceDefParseXML(virDomainChrSourceDefPtr def,
break;
case VIR_DOMAIN_CHR_TYPE_PTY:
case VIR_DOMAIN_CHR_TYPE_DEV:
case VIR_DOMAIN_CHR_TYPE_PIPE:
/* PTY path is only parsed from live xml. */
if (def->type != VIR_DOMAIN_CHR_TYPE_PTY ||
!(flags & VIR_DOMAIN_DEF_PARSE_INACTIVE))
if (!(flags & VIR_DOMAIN_DEF_PARSE_INACTIVE))
def->data.file.path = virXMLPropString(cur, "path");
break;
case VIR_DOMAIN_CHR_TYPE_DEV:
case VIR_DOMAIN_CHR_TYPE_PIPE:
def->data.file.path = virXMLPropString(cur, "path");
break;
case VIR_DOMAIN_CHR_TYPE_UNIX:
if (virDomainChrSourceDefParseUnix(def, cur) < 0)
goto error;
......@@ -11209,6 +11211,7 @@ virDomainChrSourceDefParseXML(virDomainChrSourceDefPtr def,
switch ((virDomainChrType) def->type) {
case VIR_DOMAIN_CHR_TYPE_NULL:
case VIR_DOMAIN_CHR_TYPE_PTY:
case VIR_DOMAIN_CHR_TYPE_VC:
case VIR_DOMAIN_CHR_TYPE_STDIO:
case VIR_DOMAIN_CHR_TYPE_SPICEVMC:
......@@ -11216,11 +11219,9 @@ virDomainChrSourceDefParseXML(virDomainChrSourceDefPtr def,
break;
case VIR_DOMAIN_CHR_TYPE_FILE:
case VIR_DOMAIN_CHR_TYPE_PTY:
case VIR_DOMAIN_CHR_TYPE_DEV:
case VIR_DOMAIN_CHR_TYPE_PIPE:
if (!def->data.file.path &&
def->type != VIR_DOMAIN_CHR_TYPE_PTY) {
if (!def->data.file.path) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing source path attribute for char device"));
goto error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册