Re: [Qemu-devel] [PATCH v4 1/4] Add basic version of bridge helper

2011-11-03 Thread Corey Bryant
On 11/03/2011 03:54 AM, Stefan Hajnoczi wrote: On Wed, Nov 2, 2011 at 3:12 PM, Corey Bryant wrote: On 11/02/2011 06:58 AM, Stefan Hajnoczi wrote: On Tue, Nov 1, 2011 at 5:13 PM, Corey Bryant wrote: +static bool has_vnet_hdr(int fd) +{ +unsigned int features = 0; +struct ifreq if

Re: [Qemu-devel] [PATCH v4 1/4] Add basic version of bridge helper

2011-11-03 Thread Stefan Hajnoczi
On Wed, Nov 2, 2011 at 3:12 PM, Corey Bryant wrote: > On 11/02/2011 06:58 AM, Stefan Hajnoczi wrote: >> >> On Tue, Nov 1, 2011 at 5:13 PM, Corey Bryant >>  wrote: >>> >>> +static bool has_vnet_hdr(int fd) >>> +{ >>> +    unsigned int features = 0; >>> +    struct ifreq ifreq; >>> + >>> +    if (io

Re: [Qemu-devel] [PATCH v4 1/4] Add basic version of bridge helper

2011-11-02 Thread Corey Bryant
On 11/02/2011 06:58 AM, Stefan Hajnoczi wrote: On Tue, Nov 1, 2011 at 5:13 PM, Corey Bryant wrote: +static bool has_vnet_hdr(int fd) +{ +unsigned int features = 0; +struct ifreq ifreq; + +if (ioctl(fd, TUNGETFEATURES,&features) == -1) { +return false; +} + +if (!(fea

Re: [Qemu-devel] [PATCH v4 1/4] Add basic version of bridge helper

2011-11-02 Thread Stefan Hajnoczi
On Tue, Nov 1, 2011 at 5:13 PM, Corey Bryant wrote: > +static bool has_vnet_hdr(int fd) > +{ > +    unsigned int features = 0; > +    struct ifreq ifreq; > + > +    if (ioctl(fd, TUNGETFEATURES, &features) == -1) { > +        return false; > +    } > + > +    if (!(features & IFF_VNET_HDR)) { > +

[Qemu-devel] [PATCH v4 1/4] Add basic version of bridge helper

2011-11-01 Thread Corey Bryant
This patch adds a helper that can be used to create a tap device attached to a bridge device. Since this helper is minimal in what it does, it can be given CAP_NET_ADMIN which allows qemu to avoid running as root while still satisfying the majority of what users tend to want to do with tap devices