From e3f5ec2b5e92706e3b807059f79b1fb5d936e567 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Mon, 18 May 2009 13:33:03 +0100 Subject: net: pass VLANClientState* as first arg to receive handlers Give static type checking a chance to catch errors. Signed-off-by: Mark McLoughlin --- hw/virtio-net.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'hw/virtio-net.c') diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 3ca93f5872..1ffebac222 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -288,9 +288,9 @@ static int do_virtio_net_can_receive(VirtIONet *n, int bufsize) return 1; } -static int virtio_net_can_receive(void *opaque) +static int virtio_net_can_receive(VLANClientState *vc) { - VirtIONet *n = opaque; + VirtIONet *n = vc->opaque; return do_virtio_net_can_receive(n, VIRTIO_NET_MAX_BUFSIZE); } @@ -361,9 +361,9 @@ static int receive_filter(VirtIONet *n, const uint8_t *buf, int size) return 0; } -static void virtio_net_receive(void *opaque, const uint8_t *buf, size_t size) +static void virtio_net_receive(VLANClientState *vc, const uint8_t *buf, size_t size) { - VirtIONet *n = opaque; + VirtIONet *n = vc->opaque; struct virtio_net_hdr_mrg_rxbuf *mhdr = NULL; size_t hdr_len, offset, i; -- cgit 1.4.1