diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 0373626556e7af718a2e8fa38d7c5d0fde92d25d..c4a162a69acbb501f7fbb786800fd8968abb5a1c 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -486,6 +486,10 @@ qemuOpenVhostNet(virDomainDefPtr def, "but is unavailable")); goto error; } + VIR_WARN("Unable to open vhost-net. Opened so far %d, requested %d", + i, *vhostfdSize); + *vhostfdSize = i; + break; } } virDomainAuditNetDevice(def, net, "/dev/vhost-net", *vhostfdSize); @@ -6560,12 +6564,10 @@ qemuBuildInterfaceCommandLine(virCommandPtr cmd, } for (i = 0; i < vhostfdSize; i++) { - if (vhostfd[i] >= 0) { - virCommandTransferFD(cmd, vhostfd[i]); - if (virAsprintf(&vhostfdName[i], "%d", vhostfd[i]) < 0) { - virReportOOMError(); - goto cleanup; - } + virCommandTransferFD(cmd, vhostfd[i]); + if (virAsprintf(&vhostfdName[i], "%d", vhostfd[i]) < 0) { + virReportOOMError(); + goto cleanup; } }