From: "Daniel P. Berrange" <berrange@redhat.com>
To: xen-devel@lists.xensource.com
Subject: PATCH: Don't clobber VIF 'type' field when starting a HVM guest
Date: Thu, 27 Sep 2007 17:28:59 +0100 [thread overview]
Message-ID: <20070927162859.GJ17433@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1553 bytes --]
In the Xen 3.1.0 series releases the 'VIF' config has a 'type' field which is
used to determine if using QEMU's emulated NIC vs netfront/back.
- type=ioemu -> Setup QEMU with an rtl8139 nic
- type=netfront -> Setup netback, assuming HVM pv drivers
- type is None -> Setup QEMU with rtl8139 nic & netback
In Fedora (and libvirt) we default to leaving 'type' as None, so that users
do not have to change the Dom0 guest config simply to install PV drivers in
an HVM guest.
There is one unfortunate bug though - when you start a managed VM, XenD will
re-save its configuration out to disk under /var/lib/xend/domains/[UUID]
and in doing so, it converts type=None into type=netfront. This isn't an
immediate problem because the config in memory is never changed & still
has correct settings. But some days/months later when the machine is rebooted
or XenD is restarted, it reads the config from disk & thus the rtl8139 nic
disappears from all your HVM guests :-(
The attached patch fixes server/netif.py so that it respects type=None as
the rest of the XenD code does. The patch is against xen-3.1-testing.hg
but also needs to be applied to xen-unstable.hg
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Regards,
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules: http://search.cpan.org/~danberr/ -=|
|=- Projects: http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
[-- Attachment #2: xen-vif-type-clobber.patch --]
[-- Type: text/plain, Size: 809 bytes --]
diff -r 912a5cb75c80 tools/python/xen/xend/server/netif.py
--- a/tools/python/xen/xend/server/netif.py Wed Sep 19 15:49:56 2007 +0100
+++ b/tools/python/xen/xend/server/netif.py Thu Sep 27 12:22:19 2007 -0400
@@ -108,17 +108,15 @@ class NetifController(DevController):
ipaddr = config.get('ip')
model = config.get('model')
- if not typ:
- typ = xoptions.netback_type
-
if not mac:
raise VmError("MAC address not specified or generated.")
devid = self.allocateDeviceID()
back = { 'script' : script,
- 'mac' : mac,
- 'type' : typ }
+ 'mac' : mac }
+ if typ:
+ back['type'] = typ
if ipaddr:
back['ip'] = ipaddr
if bridge:
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
reply other threads:[~2007-09-27 16:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20070927162859.GJ17433@redhat.com \
--to=berrange@redhat.com \
--cc=xen-devel@lists.xensource.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.