mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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:
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -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 *
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user