diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index 905c644d58078a56bcb2aef7bf2d420cd844bd3d..ca5b759c5d648ff18758136624e9efe9161c8c18 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -1495,8 +1495,14 @@ char *virNetworkDefFormat(const virNetworkDefPtr def, unsigned int flags) if (def->nForwardIfs && (!def->nForwardPfs || !(flags & VIR_NETWORK_XML_INACTIVE))) { for (ii = 0; ii < def->nForwardIfs; ii++) { - virBufferEscapeString(&buf, " \n", + virBufferEscapeString(&buf, " forwardIfs[ii].dev); + if (!(flags & VIR_NETWORK_XML_INACTIVE) && + (def->forwardIfs[ii].connections > 0)) { + virBufferAsprintf(&buf, " connections='%d'", + def->forwardIfs[ii].connections); + } + virBufferAddLit(&buf, "/>\n"); } } if (def->nForwardPfs || def->nForwardIfs)