From: "Daniel P. Berrange" <berrange@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Libvirt <libvir-list@redhat.com>,
qemu list <qemu-devel@nongnu.org>, Laine Stump <laine@redhat.com>
Subject: Re: [Qemu-devel] [libvirt] Problems using netdev_del+netdev_add w/o corresponding device_del+device_add
Date: Mon, 15 Oct 2012 10:25:58 +0100 [thread overview]
Message-ID: <20121015092558.GB3462@redhat.com> (raw)
In-Reply-To: <20121015083007.GC24883@stefanha-thinkpad.redhat.com>
On Mon, Oct 15, 2012 at 10:30:07AM +0200, Stefan Hajnoczi wrote:
> On Sat, Oct 13, 2012 at 04:47:14PM -0400, Laine Stump wrote:
> > Here is the sequence sent to disconnect only the host side, then
> > reconnect it with a new tap device. (although the fd is the same, this
> > is because the old tap device had already been closed, so the number is
> > just being used - the same thing happens when doing sequential full
> > detach/attach cycles, and they all work with no problems):
> >
> >
> > 168.750 > 0x7f8e20000c90
> > {"execute":"netdev_del","arguments":{"id":"hostnet0"},"id":"libvirt-30"}
> > 168.762 < 0x7f8e20000c90 {"return": {}, "id": "libvirt-30"}
> > 168.800 > 0x7f8e20000c90
> > {"execute":"getfd","arguments":{"fdname":"fd-net0"},"id":"libvirt-31"}
> > (fd=27)
> > 168.801 < 0x7f8e20000c90 {"return": {}, "id": "libvirt-31"}
> > 168.801 > 0x7f8e20000c90
> > {"execute":"netdev_add","arguments":{"type":"tap","fd":"fd-net0","id":"hostnet0"},"id":"libvirt-32"}
> > 168.802 < 0x7f8e20000c90 {"return": {}, "id": "libvirt-32"}
> > 168.802 > 0x7f8e20000c90
> > {"execute":"set_link","arguments":{"name":"net0","up":true},"id":"libvirt-33"}
> > 168.803 < 0x7f8e20000c90 {"return": {}, "id": "libvirt-33"}
> >
> > After this sequence is done, everything about the network device
> > *appears* normal on both the guest and host (at least the things I know
> > to look at), but no traffic from the host shows up in a tcpdump of the
> > interface on the guest, and no traffic from the guest shows up in a
> > tcpdump of the tap device on the host.
>
> What you are trying to do isn't possible today.
>
> The device associates with the netdev during initialization only - there
> is no command to associate at a later point in time. That is why your
> example works only when the device is deleted together with the netdev.
>
> It is certainly possible to implement a command to switch netdevs but
> I'm curious what the use case is. Is this necessary just because QEMU
> doesn't provide a way to modify the existing netdev or because you
> really want to switch to a completely different netdev?
We have end users who want to be able to dynamically change the guest'
networking attachment, without restarting/hotplugging devices in the
guest[1]. If it is just a case of changing from one bridge, to another
bridge we can do that just by moving the TAP Device from one to another.
This doesn't work if we want to support more general changes in config.
eg from a macvtap setup to a TAP setup, or vica-verca.
Another requirement is to be able to start a guest with a "null" backend
(akin to not plugging in the ethernet cable on a physical host), and
then attach it to a bridge/macvtap device on the fly later on (akin
to then plugging in the ethernet cable once running).
Regards,
Daniel
[1] Obviously the guest might need to reconfigure its IP or re-run DHCP
though.
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
next prev parent reply other threads:[~2012-10-15 9:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-13 20:47 [Qemu-devel] Problems using netdev_del+netdev_add w/o corresponding device_del+device_add Laine Stump
2012-10-15 1:43 ` Laine Stump
2012-10-15 8:30 ` Stefan Hajnoczi
2012-10-15 9:25 ` Daniel P. Berrange [this message]
2012-10-15 15:15 ` [Qemu-devel] [libvirt] " Laine Stump
2012-10-16 8:16 ` Markus Armbruster
2012-10-16 8:17 ` Stefan Hajnoczi
2012-10-16 8:08 ` Stefan Hajnoczi
2012-10-16 9:25 ` Daniel P. Berrange
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=20121015092558.GB3462@redhat.com \
--to=berrange@redhat.com \
--cc=laine@redhat.com \
--cc=libvir-list@redhat.com \
--cc=qemu-devel@nongnu.org \
--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).