aboutsummaryrefslogtreecommitdiff
path: root/hw/xen_nic.c
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2013-01-30 19:12:23 +0800
committerAnthony Liguori <aliguori@us.ibm.com>2013-02-01 11:03:00 -0600
commitcc1f0f45425d0cca41ad421623f92bebc93a21a9 (patch)
tree8015fb30e1da7eab59fbbf236f790500a47cbea0 /hw/xen_nic.c
parentb356f76de31e343121cdab3a01b39182edce9519 (diff)
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>
Diffstat (limited to 'hw/xen_nic.c')
-rw-r--r--hw/xen_nic.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/xen_nic.c b/hw/xen_nic.c
index d5b39eadd3..55b79606d4 100644
--- a/hw/xen_nic.c
+++ b/hw/xen_nic.c
@@ -236,7 +236,7 @@ static void net_rx_response(struct XenNetDev *netdev,
static int net_rx_ok(NetClientState *nc)
{
- struct XenNetDev *netdev = DO_UPCAST(NICState, nc, nc)->opaque;
+ struct XenNetDev *netdev = qemu_get_nic_opaque(nc);
RING_IDX rc, rp;
if (netdev->xendev.be_state != XenbusStateConnected) {
@@ -257,7 +257,7 @@ static int net_rx_ok(NetClientState *nc)
static ssize_t net_rx_packet(NetClientState *nc, const uint8_t *buf, size_t size)
{
- struct XenNetDev *netdev = DO_UPCAST(NICState, nc, nc)->opaque;
+ struct XenNetDev *netdev = qemu_get_nic_opaque(nc);
netif_rx_request_t rxreq;
RING_IDX rc, rp;
void *page;