提交 be956c4e 编写于 作者: A Andrea Bolognani

conf: Improve error handling in virDomainChrDefFormat()

We don't need to store the return value since we never modify it.
Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
Reviewed-by: NPavel Hrdina <phrdina@redhat.com>
上级 00b7f81f
...@@ -24037,8 +24037,6 @@ virDomainChrDefFormat(virBufferPtr buf, ...@@ -24037,8 +24037,6 @@ virDomainChrDefFormat(virBufferPtr buf,
const char *elementName = virDomainChrDeviceTypeToString(def->deviceType); const char *elementName = virDomainChrDeviceTypeToString(def->deviceType);
bool tty_compat; bool tty_compat;
int ret = 0;
if (!elementName) { if (!elementName) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected char device type %d"), _("unexpected char device type %d"),
...@@ -24059,14 +24057,14 @@ virDomainChrDefFormat(virBufferPtr buf, ...@@ -24059,14 +24057,14 @@ virDomainChrDefFormat(virBufferPtr buf,
virDomainChrSourceDefFormat(buf, def->source, flags); virDomainChrSourceDefFormat(buf, def->source, flags);
if (virDomainChrTargetDefFormat(buf, def, flags) < 0) if (virDomainChrTargetDefFormat(buf, def, flags) < 0)
return -1; return -1;
virDomainDeviceInfoFormat(buf, &def->info, flags); virDomainDeviceInfoFormat(buf, &def->info, flags);
virBufferAdjustIndent(buf, -2); virBufferAdjustIndent(buf, -2);
virBufferAsprintf(buf, "</%s>\n", elementName); virBufferAsprintf(buf, "</%s>\n", elementName);
return ret; return 0;
} }
static int static int
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册