All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Fehlig <jfehlig@novell.com>
To: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH] create proper net device for hvm guests
Date: Fri, 04 Apr 2008 17:25:57 -0600	[thread overview]
Message-ID: <47F6B905.4000800@novell.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 999 bytes --]

I've noticed that hvm guests using pv network device also get an
emulated network device.  Conversely, hvm guests using emulated network
device also get pv network device.  I'm surprised that this hasn't been
fixed already, which makes me think there is some unforeseen issue that
results from not providing both.  I guess one drawback is that the guest
config file must be edited to remove 'model=foo, type=ioemu' when using
pv network device  - but it seems the guest config file should be the
place where these types of settings are explicitly stated.

I've attached a patch the creates either the emulated or pv network
device (but not both) depending on setting in guest configuation, i.e.
'type=ioemu'.  Please apply if my reasoning is sane.  If not, please
clarify reason for presenting both :-).

Cheers,
Jim


Create either the emulated or pv network device (but not both) depending
on setting in guest configuation, i.e. 'type=ioemu'.

    Signed-off-by: Jim Fehlig <jfehlig@novell.com>



[-- Attachment #2: xend-netdev-fix.diff --]
[-- Type: text/x-patch, Size: 1142 bytes --]

diff -r db943e8d1051 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py	Tue Apr 01 10:09:33 2008 +0100
+++ b/tools/python/xen/xend/image.py	Fri Apr 04 17:09:45 2008 -0600
@@ -571,7 +571,7 @@ class HVMImageHandler(ImageHandler):
 
         for devuuid in vmConfig['vif_refs']:
             devinfo = vmConfig['devices'][devuuid][1]
-            dtype = devinfo.get('type', 'ioemu')
+            dtype = devinfo.get('type', '')
             if dtype != 'ioemu':
                 continue
             nics += 1
diff -r db943e8d1051 tools/python/xen/xend/server/netif.py
--- a/tools/python/xen/xend/server/netif.py	Tue Apr 01 10:09:33 2008 +0100
+++ b/tools/python/xen/xend/server/netif.py	Fri Apr 04 17:10:13 2008 -0600
@@ -99,6 +99,13 @@ class NetifController(DevController):
     
     def __init__(self, vm):
         DevController.__init__(self, vm)
+
+    def createDevice(self, config):
+        typ = config.get('type', '')
+        if typ == 'ioemu':
+            return 0
+
+        DevController.createDevice(self, config)
 
     def getDeviceDetails(self, config):
         """@see DevController.getDeviceDetails"""

[-- 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:[~2008-04-04 23:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-04 23:25 Jim Fehlig [this message]
2008-04-05  0:30 ` [PATCH] create proper net device for hvm guests Daniel P. Berrange
2008-04-05  2:21   ` Jim Fehlig
2008-04-23 10:07     ` David Edmondson

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=47F6B905.4000800@novell.com \
    --to=jfehlig@novell.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.