diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 1440d32aec3f5a8190a94a1b22fa6640e8699952..76c5bcb4f9b451d6185382bf4be3756c0576b40b 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3742,19 +3742,18 @@ qemuBuildHostNetStr(virDomainNetDefPtr net, } if (vlan >= 0) { - virBufferAsprintf(&buf, "vlan=%d", vlan); + virBufferAsprintf(&buf, "vlan=%d,", vlan); if (net->info.alias) - virBufferAsprintf(&buf, ",name=host%s", - net->info.alias); + virBufferAsprintf(&buf, "name=host%s,", net->info.alias); } else { - virBufferAsprintf(&buf, "id=host%s", net->info.alias); + virBufferAsprintf(&buf, "id=host%s,", net->info.alias); } if (is_tap) { if (vhostfdSize) { - virBufferAddLit(&buf, ",vhost=on,"); + virBufferAddLit(&buf, "vhost=on,"); if (vhostfdSize == 1) { - virBufferAsprintf(&buf, "vhostfd=%s", vhostfd[0]); + virBufferAsprintf(&buf, "vhostfd=%s,", vhostfd[0]); } else { virBufferAddLit(&buf, "vhostfds="); for (i = 0; i < vhostfdSize; i++) { @@ -3762,14 +3761,16 @@ qemuBuildHostNetStr(virDomainNetDefPtr net, virBufferAddChar(&buf, ':'); virBufferAdd(&buf, vhostfd[i], -1); } + virBufferAddChar(&buf, ','); } } if (net->tune.sndbuf_specified) - virBufferAsprintf(&buf, ",sndbuf=%lu", net->tune.sndbuf); + virBufferAsprintf(&buf, "sndbuf=%lu,", net->tune.sndbuf); } virObjectUnref(cfg); + virBufferTrim(&buf, ",", -1); if (virBufferCheckError(&buf) < 0) return NULL;