qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Mike Lovell <mike@dev-zero.net>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] net: Allow specifying ifname for qemu-bridge-helper
Date: Fri, 12 Oct 2012 12:04:15 -0600	[thread overview]
Message-ID: <50785B9F.50609@dev-zero.net> (raw)
In-Reply-To: <5077D584.3040204@msgid.tls.msk.ru>

On 10/12/2012 02:32 AM, Michael Tokarev wrote:
> On 12.10.2012 10:49, Mike Lovell wrote:
>>       /* request a tap device, disable PI, and add vnet header support if
>> -     * requested and it's available. */
>> -    prep_ifreq(&ifr, "tap%d");
>> +     * requested and it's available. use ifname if provided for tap name. */
>> +    prep_ifreq(&ifr, ifname != NULL ? ifname : "tap%d");
> Should we check for special symbols here? prep_ifreq() does this:
>
>      snprintf(ifr->ifr_name, IFNAMSIZ, "%s", ifname);
>
> so at least it ensures we have length constraint.

I tried the code as is with specifying ifnames with various random 
combinations of special characters. Some of them we just allowed 
through, some caused an error when initializing the tap device, and some 
cause problems in the shell invoking qemu. I think the linux kernel does 
the necessary checking during the TUNSETIFF ioctl and the 
qemu-bridge-helper exits with an error if there was a problem.

> Actually I'm not so sure anymore this is a good idea.
> For example, system may have firewall (iptables) rules
> in place for, say, future ppp interfaces for ppp clients,
> and this way we may request the interface to be named
> pppX and be allowed to send packets where we don't usually
> have access to.

While I admit this does have that possibility, I'm not sure its a qemu 
problem. I don't know what the original motivation for the request was 
but I could see this being the reason for the request. Some 
administrator sets up firewall rules for a variety of guests ahead of 
actually running them and needs to specify the interface at runtime. 
Also, without using the helper programs, the qemu already allows 
specifying arbitrary names such as ppp0.

> Maybe - at least - require some common prefix for the
> interfaces created this way, so we'll live in our own,
> easily distinguishable namespace -- like, qvif* (from
> Qemu Virtual InterFace)?

I do like the idea of using a common prefix for the default name of tap 
devices. Something like "qvif%d" instead of "tap%d" in tap 
initialization code. But something tells me this could break 
compatibility with external management software where something might be 
expecting the interface name to start with tap.

mike

  reply	other threads:[~2012-10-12 18:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-10 15:05 [Qemu-devel] [feature request] qemu-bridge-helper Mario De Chenno
2012-10-11 15:31 ` Corey Bryant
2012-10-12  6:49   ` [Qemu-devel] [PATCH] net: Allow specifying ifname for qemu-bridge-helper Mike Lovell
2012-10-12  7:03     ` Mike Lovell
2012-10-12  8:32     ` Michael Tokarev
2012-10-12 18:04       ` Mike Lovell [this message]
2012-11-30 10:02         ` Michael Tokarev
2012-11-30 14:32           ` Paolo Bonzini
2012-11-30  7:10     ` Mike Lovell
2012-11-30 14:35       ` Paolo Bonzini
2012-12-03 13:10         ` Stefan Hajnoczi

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=50785B9F.50609@dev-zero.net \
    --to=mike@dev-zero.net \
    --cc=mjt@tls.msk.ru \
    --cc=qemu-devel@nongnu.org \
    /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).