mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
net: introduce qemu_get_peer
This is a small function that can get the peer from given NetClientState and queue_index Signed-off-by: Cindy Lu <lulu@redhat.com> Message-Id: <20200701145538.22333-2-lulu@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
parent
8bc43f39a9
commit
0165daae5c
2 changed files with 8 additions and 0 deletions
|
@ -325,6 +325,13 @@ void *qemu_get_nic_opaque(NetClientState *nc)
|
|||
return nic->opaque;
|
||||
}
|
||||
|
||||
NetClientState *qemu_get_peer(NetClientState *nc, int queue_index)
|
||||
{
|
||||
assert(nc != NULL);
|
||||
NetClientState *ncs = nc + queue_index;
|
||||
return ncs->peer;
|
||||
}
|
||||
|
||||
static void qemu_cleanup_net_client(NetClientState *nc)
|
||||
{
|
||||
QTAILQ_REMOVE(&net_clients, nc, next);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue