mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
net: introduce qemu_get_nic()
To support multiqueue, this patch introduces a helper qemu_get_nic() to get NICState from a NetClientState. The following patches would refactor this helper to support multiqueue. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
b356f76de3
commit
cc1f0f4542
28 changed files with 92 additions and 78 deletions
|
@ -64,7 +64,7 @@ static int mipsnet_buffer_full(MIPSnetState *s)
|
|||
|
||||
static int mipsnet_can_receive(NetClientState *nc)
|
||||
{
|
||||
MIPSnetState *s = DO_UPCAST(NICState, nc, nc)->opaque;
|
||||
MIPSnetState *s = qemu_get_nic_opaque(nc);
|
||||
|
||||
if (s->busy)
|
||||
return 0;
|
||||
|
@ -73,7 +73,7 @@ static int mipsnet_can_receive(NetClientState *nc)
|
|||
|
||||
static ssize_t mipsnet_receive(NetClientState *nc, const uint8_t *buf, size_t size)
|
||||
{
|
||||
MIPSnetState *s = DO_UPCAST(NICState, nc, nc)->opaque;
|
||||
MIPSnetState *s = qemu_get_nic_opaque(nc);
|
||||
|
||||
trace_mipsnet_receive(size);
|
||||
if (!mipsnet_can_receive(nc))
|
||||
|
@ -211,7 +211,7 @@ static const VMStateDescription vmstate_mipsnet = {
|
|||
|
||||
static void mipsnet_cleanup(NetClientState *nc)
|
||||
{
|
||||
MIPSnetState *s = DO_UPCAST(NICState, nc, nc)->opaque;
|
||||
MIPSnetState *s = qemu_get_nic_opaque(nc);
|
||||
|
||||
s->nic = NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue