qemu: command: Don't hide 'vhost' fds from 'standalone' command line

We already format a commandline using FD passing for the tap devices so
formatting the 'vhost' file descriptors won't make it any less usable
directly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Peter Krempa
2022-05-13 13:49:08 +02:00
parent 5b9c880e89
commit 0b64b75a09
3 changed files with 7 additions and 13 deletions

View File

@@ -8684,8 +8684,7 @@ qemuInterfaceVhostuserConnect(virCommand *cmd,
int int
qemuBuildInterfaceConnect(virDomainObj *vm, qemuBuildInterfaceConnect(virDomainObj *vm,
virDomainNetDef *net, virDomainNetDef *net,
virNetDevVPortProfileOp vmop, virNetDevVPortProfileOp vmop)
bool standalone)
{ {
qemuDomainObjPrivate *priv = vm->privateData; qemuDomainObjPrivate *priv = vm->privateData;
@@ -8767,7 +8766,7 @@ qemuBuildInterfaceConnect(virDomainObj *vm,
} }
} }
if (vhostfd && !standalone) { if (vhostfd) {
if (qemuInterfaceOpenVhostNet(vm, net) < 0) if (qemuInterfaceOpenVhostNet(vm, net) < 0)
return -1; return -1;
} }
@@ -8783,7 +8782,6 @@ qemuBuildInterfaceCommandLine(virQEMUDriver *driver,
virDomainNetDef *net, virDomainNetDef *net,
virQEMUCaps *qemuCaps, virQEMUCaps *qemuCaps,
virNetDevVPortProfileOp vmop, virNetDevVPortProfileOp vmop,
bool standalone,
size_t *nnicindexes, size_t *nnicindexes,
int **nicindexes) int **nicindexes)
{ {
@@ -8801,7 +8799,7 @@ qemuBuildInterfaceCommandLine(virQEMUDriver *driver,
if (qemuDomainValidateActualNetDef(net, qemuCaps) < 0) if (qemuDomainValidateActualNetDef(net, qemuCaps) < 0)
return -1; return -1;
if (qemuBuildInterfaceConnect(vm, net, vmop, standalone) < 0) if (qemuBuildInterfaceConnect(vm, net, vmop) < 0)
return -1; return -1;
switch (actualType) { switch (actualType) {
@@ -8991,7 +8989,6 @@ qemuBuildNetCommandLine(virQEMUDriver *driver,
virCommand *cmd, virCommand *cmd,
virQEMUCaps *qemuCaps, virQEMUCaps *qemuCaps,
virNetDevVPortProfileOp vmop, virNetDevVPortProfileOp vmop,
bool standalone,
size_t *nnicindexes, size_t *nnicindexes,
int **nicindexes) int **nicindexes)
{ {
@@ -9005,8 +9002,7 @@ qemuBuildNetCommandLine(virQEMUDriver *driver,
if (qemuBuildInterfaceCommandLine(driver, vm, cmd, net, if (qemuBuildInterfaceCommandLine(driver, vm, cmd, net,
qemuCaps, vmop, qemuCaps, vmop,
standalone, nnicindexes, nnicindexes, nicindexes) < 0)
nicindexes) < 0)
goto error; goto error;
last_good_net = i; last_good_net = i;
@@ -10596,8 +10592,7 @@ qemuBuildCommandLine(virQEMUDriver *driver,
if (qemuBuildFilesystemCommandLine(cmd, def, qemuCaps, priv) < 0) if (qemuBuildFilesystemCommandLine(cmd, def, qemuCaps, priv) < 0)
return NULL; return NULL;
if (qemuBuildNetCommandLine(driver, vm, cmd, if (qemuBuildNetCommandLine(driver, vm, cmd, qemuCaps, vmop,
qemuCaps, vmop, standalone,
nnicindexes, nicindexes) < 0) nnicindexes, nicindexes) < 0)
return NULL; return NULL;

View File

@@ -91,8 +91,7 @@ qemuBuildHostNetProps(virDomainNetDef *net);
int int
qemuBuildInterfaceConnect(virDomainObj *vm, qemuBuildInterfaceConnect(virDomainObj *vm,
virDomainNetDef *net, virDomainNetDef *net,
virNetDevVPortProfileOp vmop, virNetDevVPortProfileOp vmop);
bool standalone);
/* Current, best practice */ /* Current, best practice */
virJSONValue * virJSONValue *

View File

@@ -1268,7 +1268,7 @@ qemuDomainAttachNetDevice(virQEMUDriver *driver,
*/ */
VIR_APPEND_ELEMENT_COPY(vm->def->nets, vm->def->nnets, net); VIR_APPEND_ELEMENT_COPY(vm->def->nets, vm->def->nnets, net);
if (qemuBuildInterfaceConnect(vm, net, VIR_NETDEV_VPORT_PROFILE_OP_CREATE, false) < 0) if (qemuBuildInterfaceConnect(vm, net, VIR_NETDEV_VPORT_PROFILE_OP_CREATE) < 0)
return -1; return -1;
iface_connected = true; iface_connected = true;