mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
net: import linux tap ioctl definitions
Making features dependent on the availability of newer versions if_tun.h is going to get seriously clumsy, so let's just import the definitions we need. It's only a small handful. If and when we're comfortable depending on 2.6.30 headers, we can remove this again. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
1abb817258
commit
76682299a8
3 changed files with 31 additions and 17 deletions
11
net.c
11
net.c
|
@ -46,7 +46,7 @@
|
|||
#include <net/if_tap.h>
|
||||
#endif
|
||||
#ifdef __linux__
|
||||
#include <linux/if_tun.h>
|
||||
#include "tap-linux.h"
|
||||
#endif
|
||||
#include <arpa/inet.h>
|
||||
#include <dirent.h>
|
||||
|
@ -1385,7 +1385,6 @@ static void tap_send(void *opaque)
|
|||
} while (size > 0);
|
||||
}
|
||||
|
||||
#ifdef TUNSETSNDBUF
|
||||
/* sndbuf should be set to a value lower than the tx queue
|
||||
* capacity of any destination network interface.
|
||||
* Ethernet NICs generally have txqueuelen=1000, so 1Mb is
|
||||
|
@ -1408,12 +1407,6 @@ static int tap_set_sndbuf(TAPState *s, QemuOpts *opts)
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
static int tap_set_sndbuf(TAPState *s, QemuOpts *opts)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* TUNSETSNDBUF */
|
||||
|
||||
static void tap_cleanup(VLANClientState *vc)
|
||||
{
|
||||
|
@ -2987,12 +2980,10 @@ static struct {
|
|||
.name = "downscript",
|
||||
.type = QEMU_OPT_STRING,
|
||||
.help = "script to shut down the interface",
|
||||
#ifdef TUNSETSNDBUF
|
||||
}, {
|
||||
.name = "sndbuf",
|
||||
.type = QEMU_OPT_SIZE,
|
||||
.help = "send buffer limit"
|
||||
#endif
|
||||
},
|
||||
{ /* end of list */ }
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue