conf: Improve error handling in virDomainChrDefFormat()

We don't need to store the return value since we never modify it.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Andrea Bolognani 2017-11-20 18:07:20 +01:00
parent 00b7f81fa8
commit be956c4e38
1 changed files with 2 additions and 4 deletions

View File

@ -24037,8 +24037,6 @@ virDomainChrDefFormat(virBufferPtr buf,
const char *elementName = virDomainChrDeviceTypeToString(def->deviceType);
bool tty_compat;
int ret = 0;
if (!elementName) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected char device type %d"),
@ -24059,14 +24057,14 @@ virDomainChrDefFormat(virBufferPtr buf,
virDomainChrSourceDefFormat(buf, def->source, flags);
if (virDomainChrTargetDefFormat(buf, def, flags) < 0)
return -1;
return -1;
virDomainDeviceInfoFormat(buf, &def->info, flags);
virBufferAdjustIndent(buf, -2);
virBufferAsprintf(buf, "</%s>\n", elementName);
return ret;
return 0;
}
static int