diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2009-12-24 14:46:29 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-01-08 09:58:40 -0600 |
commit | 983a4ac4471419d7d5569cc6988d5265d2da3585 (patch) | |
tree | a3314395ea15958581352493bde96eb9b529291c /net.h | |
parent | 98750f2a92758c3e07fe3f286acaeb267c791444 (diff) | |
download | qemu-983a4ac4471419d7d5569cc6988d5265d2da3585.tar.gz qemu-983a4ac4471419d7d5569cc6988d5265d2da3585.tar.bz2 qemu-983a4ac4471419d7d5569cc6988d5265d2da3585.zip |
net: add API to disable/enable polling
When vhost is bound to a backend device, we need to stop polling it when
vhost is started, and restart polling when vhost is stopped.
Add an API for that for use by vhost, and implement in tap backend.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'net.h')
-rw-r--r-- | net.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1,6 +1,7 @@ #ifndef QEMU_NET_H #define QEMU_NET_H +#include <stdbool.h> #include "qemu-queue.h" #include "qemu-common.h" #include "qdict.h" @@ -36,6 +37,7 @@ typedef enum { NET_CLIENT_TYPE_DUMP } net_client_type; +typedef void (NetPoll)(VLANClientState *, bool enable); typedef int (NetCanReceive)(VLANClientState *); typedef ssize_t (NetReceive)(VLANClientState *, const uint8_t *, size_t); typedef ssize_t (NetReceiveIOV)(VLANClientState *, const struct iovec *, int); @@ -51,6 +53,7 @@ typedef struct NetClientInfo { NetCanReceive *can_receive; NetCleanup *cleanup; LinkStatusChanged *link_status_changed; + NetPoll *poll; } NetClientInfo; struct VLANClientState { |