mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-07 12:58:20 +00:00
struct iovec is now universally available (Mark McLoughlin)
struct iovec is now defined in qemu-common.h if needed, so we don't need the tap code to handle !defined(HAVE_IOVEC). Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7143 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
559a8f45f3
commit
efb816c9a8
4
net.c
4
net.c
@ -702,7 +702,6 @@ typedef struct TAPState {
|
|||||||
char down_script_arg[128];
|
char down_script_arg[128];
|
||||||
} TAPState;
|
} TAPState;
|
||||||
|
|
||||||
#ifdef HAVE_IOVEC
|
|
||||||
static ssize_t tap_receive_iov(void *opaque, const struct iovec *iov,
|
static ssize_t tap_receive_iov(void *opaque, const struct iovec *iov,
|
||||||
int iovcnt)
|
int iovcnt)
|
||||||
{
|
{
|
||||||
@ -715,7 +714,6 @@ static ssize_t tap_receive_iov(void *opaque, const struct iovec *iov,
|
|||||||
|
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static void tap_receive(void *opaque, const uint8_t *buf, int size)
|
static void tap_receive(void *opaque, const uint8_t *buf, int size)
|
||||||
{
|
{
|
||||||
@ -762,9 +760,7 @@ static TAPState *net_tap_fd_init(VLANState *vlan,
|
|||||||
s = qemu_mallocz(sizeof(TAPState));
|
s = qemu_mallocz(sizeof(TAPState));
|
||||||
s->fd = fd;
|
s->fd = fd;
|
||||||
s->vc = qemu_new_vlan_client(vlan, model, name, tap_receive, NULL, s);
|
s->vc = qemu_new_vlan_client(vlan, model, name, tap_receive, NULL, s);
|
||||||
#ifdef HAVE_IOVEC
|
|
||||||
s->vc->fd_readv = tap_receive_iov;
|
s->vc->fd_readv = tap_receive_iov;
|
||||||
#endif
|
|
||||||
qemu_set_fd_handler(s->fd, tap_send, NULL, s);
|
qemu_set_fd_handler(s->fd, tap_send, NULL, s);
|
||||||
snprintf(s->vc->info_str, sizeof(s->vc->info_str), "fd=%d", fd);
|
snprintf(s->vc->info_str, sizeof(s->vc->info_str), "fd=%d", fd);
|
||||||
return s;
|
return s;
|
||||||
|
Loading…
Reference in New Issue
Block a user