mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
qemu: Convert passing of 'slirpfd' to 'qemuFDPassDirect'
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
1715dfce38
commit
7e1c24c925
@ -4289,7 +4289,7 @@ qemuBuildHostNetProps(virDomainNetDef *net)
|
||||
if (netpriv->slirpfd) {
|
||||
if (virJSONValueObjectAdd(&netprops,
|
||||
"s:type", "socket",
|
||||
"s:fd", qemuFDPassGetPath(netpriv->slirpfd),
|
||||
"s:fd", qemuFDPassDirectGetPath(netpriv->slirpfd),
|
||||
NULL) < 0)
|
||||
return NULL;
|
||||
} else {
|
||||
@ -8884,8 +8884,9 @@ qemuBuildInterfaceCommandLine(virQEMUDriver *driver,
|
||||
for (n = netpriv->vhostfds; n; n = n->next)
|
||||
qemuFDPassDirectTransferCommand(n->data, cmd);
|
||||
|
||||
if (qemuFDPassTransferCommand(netpriv->slirpfd, cmd) < 0 ||
|
||||
qemuFDPassTransferCommand(netpriv->vdpafd, cmd) < 0)
|
||||
qemuFDPassDirectTransferCommand(netpriv->slirpfd, cmd);
|
||||
|
||||
if (qemuFDPassTransferCommand(netpriv->vdpafd, cmd) < 0)
|
||||
return -1;
|
||||
|
||||
if (!(hostnetprops = qemuBuildHostNetProps(net)))
|
||||
|
@ -1051,7 +1051,7 @@ qemuDomainNetworkPrivateClearFDs(qemuDomainNetworkPrivate *priv)
|
||||
if (!priv)
|
||||
return;
|
||||
|
||||
g_clear_pointer(&priv->slirpfd, qemuFDPassFree);
|
||||
g_clear_pointer(&priv->slirpfd, qemuFDPassDirectFree);
|
||||
g_clear_pointer(&priv->vdpafd, qemuFDPassFree);
|
||||
g_slist_free_full(g_steal_pointer(&priv->vhostfds), (GDestroyNotify) qemuFDPassDirectFree);
|
||||
g_slist_free_full(g_steal_pointer(&priv->tapfds), (GDestroyNotify) qemuFDPassDirectFree);
|
||||
|
@ -403,7 +403,7 @@ struct _qemuDomainNetworkPrivate {
|
||||
qemuSlirp *slirp;
|
||||
|
||||
/* file descriptor transfer helpers */
|
||||
qemuFDPass *slirpfd;
|
||||
qemuFDPassDirect *slirpfd;
|
||||
GSList *tapfds; /* qemuFDPassDirect */
|
||||
GSList *vhostfds; /* qemuFDPassDirect */
|
||||
qemuFDPass *vdpafd;
|
||||
|
@ -1386,7 +1386,7 @@ qemuDomainAttachNetDevice(virQEMUDriver *driver,
|
||||
}
|
||||
}
|
||||
|
||||
if (qemuFDPassTransferMonitor(netpriv->slirpfd, priv->mon) < 0 ||
|
||||
if (qemuFDPassDirectTransferMonitor(netpriv->slirpfd, priv->mon) < 0 ||
|
||||
qemuFDPassTransferMonitor(netpriv->vdpafd, priv->mon) < 0) {
|
||||
qemuDomainObjExitMonitor(vm);
|
||||
goto cleanup;
|
||||
|
@ -352,9 +352,7 @@ qemuSlirpStart(virDomainObj *vm,
|
||||
|
||||
slirp->pid = pid;
|
||||
|
||||
netpriv->slirpfd = qemuFDPassNewDirect(fdname, priv);
|
||||
|
||||
qemuFDPassAddFD(netpriv->slirpfd, &slirp->fd[0], NULL);
|
||||
netpriv->slirpfd = qemuFDPassDirectNew(fdname, &slirp->fd[0]);
|
||||
|
||||
return 0;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user