virtio-net support
This adds virtio-net support. This is based on the virtio-net driver
that exists in kvm-userspace. This also adds a new qemu_sendv_packet
which virtio-net requires.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6073 c046a42c-6fe2-441c-8c8c-71466251a162
diff --git a/net.h b/net.h
index a2b01ae..63ba7ed 100644
--- a/net.h
+++ b/net.h
@@ -1,12 +1,17 @@
#ifndef QEMU_NET_H
#define QEMU_NET_H
+#include "qemu-common.h"
+
/* VLANs support */
+typedef ssize_t (IOReadvHandler)(void *, const struct iovec *, int);
+
typedef struct VLANClientState VLANClientState;
struct VLANClientState {
IOReadHandler *fd_read;
+ IOReadvHandler *fd_readv;
/* Packets may still be sent if this returns zero. It's used to
rate-limit the slirp code. */
IOCanRWHandler *fd_can_read;
@@ -30,6 +35,8 @@
void *opaque);
void qemu_del_vlan_client(VLANClientState *vc);
int qemu_can_send_packet(VLANClientState *vc);
+ssize_t qemu_sendv_packet(VLANClientState *vc, const struct iovec *iov,
+ int iovcnt);
void qemu_send_packet(VLANClientState *vc, const uint8_t *buf, int size);
void qemu_handler_true(void *opaque);