From: Corey Bryant <coreyb@linux.vnet.ibm.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: rmarwah@linux.vnet.ibm.com, aliguori@us.ibm.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v4 1/4] Add basic version of bridge helper
Date: Thu, 03 Nov 2011 09:11:10 -0400 [thread overview]
Message-ID: <4EB292EE.5020804@linux.vnet.ibm.com> (raw)
In-Reply-To: <CAJSP0QX-=_bHYP_hfQKift=CLye1ffnrz8yWtAZmZimuAN+01Q@mail.gmail.com>
On 11/03/2011 03:54 AM, Stefan Hajnoczi wrote:
> On Wed, Nov 2, 2011 at 3:12 PM, Corey Bryant<coreyb@linux.vnet.ibm.com> wrote:
>> On 11/02/2011 06:58 AM, Stefan Hajnoczi wrote:
>>>
>>> On Tue, Nov 1, 2011 at 5:13 PM, Corey Bryant<coreyb@linux.vnet.ibm.com>
>>> 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)) {
>>>> + return false;
>>>> + }
>>>> +
>>>> + if (ioctl(fd, TUNGETIFF,&ifreq) != -1 || errno != EBADFD) {
>>>> + return false;
>>>> + }
>>>
>>> I don't understand this expression. We want TUNGETIFF to fail with
>>> EBADFD, otherwise we return false. What is this trying to do?
>>>
>>> Why do we even need TUNGETIFF after TUNGETFEATURES succeeded and we
>>> were able to check out the IFF_VNET_HDR flag?
>>>
>>> Stefan
>>>
>>
>> I don't think the TUNGETIFF call is necessary. It verifies that the tap
>> device doesn't already exist. The ensuing TUNSETIFF call should already
>> cover this.
>
> Thanks for explaining. It would be nice to comment this or drop the
> if statement entirely if you are sending another revision of this
> patch series.
>
> Stefan
>
You're welcome, and thanks for the comment. I'll drop this if statement
in the next version of the patch series.
Regards,
Corey
next prev parent reply other threads:[~2011-11-03 13:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-01 17:13 [Qemu-devel] [PATCH v4 0/4] -net bridge: rootless bridge support for qemu Corey Bryant
2011-11-01 17:13 ` [Qemu-devel] [PATCH v4 1/4] Add basic version of bridge helper Corey Bryant
2011-11-02 10:58 ` Stefan Hajnoczi
2011-11-02 15:12 ` Corey Bryant
2011-11-03 7:54 ` Stefan Hajnoczi
2011-11-03 13:11 ` Corey Bryant [this message]
2011-11-01 17:13 ` [Qemu-devel] [PATCH v4 2/4] Add access control support to qemu " Corey Bryant
2011-11-01 17:13 ` [Qemu-devel] [PATCH v4 3/4] Add cap reduction support to enable use as SUID Corey Bryant
2011-11-01 17:13 ` [Qemu-devel] [PATCH v4 4/4] Add support for net bridge Corey Bryant
2011-11-02 8:12 ` Mark Wu
2011-11-02 15:52 ` Corey Bryant
2011-11-08 6:46 ` [Qemu-devel] [PATCH v4 0/4] -net bridge: rootless bridge support for qemu Zhi Yong Wu
2011-11-08 15:37 ` Corey Bryant
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4EB292EE.5020804@linux.vnet.ibm.com \
--to=coreyb@linux.vnet.ibm.com \
--cc=aliguori@us.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=rmarwah@linux.vnet.ibm.com \
--cc=stefanha@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).