From: Corey Bryant <coreyb@linux.vnet.ibm.com>
To: Mark Wu <wudxw@linux.vnet.ibm.com>
Cc: rmarwah@linux.vnet.ibm.com, aliguori@us.ibm.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v4 4/4] Add support for net bridge
Date: Wed, 02 Nov 2011 11:52:28 -0400 [thread overview]
Message-ID: <4EB1673C.7060407@linux.vnet.ibm.com> (raw)
In-Reply-To: <4EB0FB75.7050307@linux.vnet.ibm.com>
On 11/02/2011 04:12 AM, Mark Wu wrote:
> On 11/02/2011 01:13 AM, Corey Bryant wrote:
>> static int net_tap_init(QemuOpts *opts, int *vnet_hdr)
>> {
>> int fd, vnet_hdr_required;
>> @@ -433,8 +570,11 @@ int net_init_tap(QemuOpts *opts, Monitor *mon,
>> const char *name, VLANState *vlan
>> if (qemu_opt_get(opts, "ifname") ||
>> qemu_opt_get(opts, "script") ||
>> qemu_opt_get(opts, "downscript") ||
>> - qemu_opt_get(opts, "vnet_hdr")) {
>> - error_report("ifname=, script=, downscript= and vnet_hdr= is invalid
>> with fd=");
>> + qemu_opt_get(opts, "vnet_hdr") ||
>> + qemu_opt_get(opts, "br") ||
>> + qemu_opt_get(opts, "helper")) {
>> + error_report("ifname=, script=, downscript=, vnet_hdr=,"
>> + "br= and helper= are invalid with fd=");
>> return -1;
>> }
> If
>> @@ -446,7 +586,40 @@ int net_init_tap(QemuOpts *opts, Monitor *mon,
>> const char *name, VLANState *vlan
>> fcntl(fd, F_SETFL, O_NONBLOCK);
>>
>> vnet_hdr = tap_probe_vnet_hdr(fd);
>> + } else if (qemu_opt_get(opts, "helper")) {
>> + if (qemu_opt_get(opts, "ifname") ||
>> + qemu_opt_get(opts, "script") ||
>> + qemu_opt_get(opts, "downscript")) {
>> + error_report("ifname=, script= and downscript="
>> + "are invalid with helper=");
>> + return -1;
>> + }
>> +
>> + if (!qemu_opt_get(opts, "br")) {
>> + qemu_opt_set(opts, "br", DEFAULT_BRIDGE_INTERFACE);
>> + }
>> +
>> + fd = net_bridge_run_helper(qemu_opt_get(opts, "helper"),
>> + qemu_opt_get(opts, "br"));
>> + if (fd == -1) {
>> + return -1;
>> + }
>> +
>> + fcntl(fd, F_SETFL, O_NONBLOCK);
>> +
>> + vnet_hdr = tap_probe_vnet_hdr(fd);
>> +
>> + s = net_tap_fd_init(vlan, "bridge", name, fd, vnet_hdr);
>>
> The helper run with "--use-vnet" by default, so the option "vnet_hdr"
> will not be honored. We can make "vnet_hdr" invalid with "br" or check
> the option "vnet_hdr" in function net_bridge_run_helper.
>
Good point. It seems like we should honor the "vnet_hdr" option rather
than make it invalid for a network helper.
--
Regards,
Corey
next prev parent reply other threads:[~2011-11-02 15:56 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
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 [this message]
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=4EB1673C.7060407@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=wudxw@linux.vnet.ibm.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).