diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index ead8cf88c6..e3830803f1 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -11546,7 +11546,6 @@ virDomainActualNetDefFormat(virBufferPtr buf, virDomainActualNetDefPtr def, unsigned int flags) { - int ret = -1; const char *type; const char *mode; @@ -11557,7 +11556,7 @@ virDomainActualNetDefFormat(virBufferPtr buf, if (!type) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unexpected net type %d"), def->type); - return ret; + return -1; } virBufferAsprintf(buf, " data.direct.mode); - return ret; + return -1; } virBufferAsprintf(buf, " mode='%s'/>\n", mode); break; @@ -11603,21 +11602,18 @@ virDomainActualNetDefFormat(virBufferPtr buf, default: virReportError(VIR_ERR_INTERNAL_ERROR, _("unexpected net type %s"), type); - goto error; + return -1; } virBufferAdjustIndent(buf, 8); if (virNetDevVPortProfileFormat(def->virtPortProfile, buf) < 0) return -1; if (virNetDevBandwidthFormat(def->bandwidth, buf) < 0) - goto error; + return -1; virBufferAdjustIndent(buf, -8); virBufferAddLit(buf, " \n"); - - ret = 0; -error: - return ret; + return 0; } static int