On Wed, Jan 26, 2005 at 08:36:34PM +0000, Mark Williamson wrote:
> > Ok, an update on the matter. The reason no interface appeared in the domU
> > netif backend was because xend wasn't actually configuring the domain as a
> > backend. The reason being that xend was setting the backend configuration
> > flags /after/ constructing the domain image [1], so nothing was happening.
>
> Ah. Do you have a patch for this we could apply?
Yep, patch attached. Also includes a change to make specifying the backend
domain more user friendly.
> > With that changed, a vif appears in the netif backend when the other domU
> > is started up. However, no actual network connection can be made between
> > the domains; ping just responds back with a destination host unreachable
> > error.
>
> Have you tried the hack Andy suggested (giving the backend domain access to a
> PCI device it has no drivers for) so that the backend domain will be
> privileged? If you don't elevate its privilege level some how it will
> definitely not be able to function as a backend.
Yay. Tried that (pointed the backend domain to the unused onboard audio
controller :) and it worked perfectly.
One thing though; all backend interfaces have the same mac address,
FE:FF:FF:FF:FF:FF. I see that Keir committed this change, along with a note
about problems with bridging with the previous code.
If i modify the code such that i can specify an explicit backend vif mac
address to xend, and then that gets passed into the backend (with
fe:ff:ff:ff:ff:ff being sent if no explicit one is given), what would be the
best way to go about avoiding the problems mentioned when doing so?
In case you're wondering why i need this change, it's because i need some way
to distingush the vif's in the backend domain, so that i can configure them
easily with the linux hotplug system (since, obviously, xend is neither running
in the domain, nor can the dom0 instance configure the interface)
> > Seperately, although still connected to networking, the netfront driver has
> > code in it that prevents it from loading in a backend domain as well as the
> > initial domain. That should probably be reduced down to just checking for
> > the initial domain.
>
> Yes, this can probably be safely removed now. Does removing the backend
> check
> work for you?
Seems to work fine. Tried it out after i finally got the inter-domU networking
working. No problems appeared with front only, back only or front-and-back
configurations. Patch attached for this as well.
> Thanks for working with us on this.
No probs. Had a good time working through the code to figure out what was going
on.
J
--
Jody Belka
knew (at) pimb (dot) org
diff -durN tools.orig/python/xen/xend/XendDomainInfo.py
tools/python/xen/xend/XendDomainInfo.py
--- tools.orig/python/xen/xend/XendDomainInfo.py 2005-01-27
01:06:28.840379840 +0100
+++ tools/python/xen/xend/XendDomainInfo.py 2005-01-25 16:20:44.000000000
+0100
@@ -449,9 +449,9 @@
self.init_domain()
self.configure_console()
+ self.configure_backends()
self.construct_image()
self.configure_restart()
- self.configure_backends()
deferred = self.configure()
def cberr(err):
self.destroy()
diff -durN tools.orig/python/xen/xend/server/netif.py
tools/python/xen/xend/server/netif.py
--- tools.orig/python/xen/xend/server/netif.py 2005-01-25 10:09:39.000000000
+0100
+++ tools/python/xen/xend/server/netif.py 2005-01-27 01:19:29.043770896
+0100
@@ -140,7 +140,8 @@
self.ipaddr = self._get_config_ipaddr(config) or []
try:
- self.backendDomain = int(sxp.child_value(config, 'backend', '0'))
+ xd = get_component('xen.xend.XendDomain')
+ self.backendDomain = int(xd.domain_lookup(sxp.child_value(config,
'backend', '0')).id)
except:
raise XendError('invalid backend domain')
@@ -161,7 +162,8 @@
bridge = sxp.child_value(config, 'bridge')
script = sxp.child_value(config, 'script')
ipaddr = self._get_config_ipaddr(config)
- backendDomain = sxp.child_value(config, 'backend', '0')
+ xd = get_component('xen.xend.XendDomain')
+ backendDomain = str(xd.domain_lookup(sxp.child_value(config,
'backend', '0')).id)
if (mac is not None) and (mac != self.mac):
raise XendError("cannot change mac")
if (backendDomain is not None) and (backendDomain !=
str(self.backendDomain)):
diff -durN linux-2.6.10-xen-sparse.orig/drivers/xen/netfront/netfront.c
linux-2.6.10-xen-sparse/drivers/xen/netfront/netfront.c
--- linux-2.6.10-xen-sparse.orig/drivers/xen/netfront/netfront.c
2005-01-27 01:02:55.724778336 +0100
+++ linux-2.6.10-xen-sparse/drivers/xen/netfront/netfront.c 2005-01-27
01:03:07.039058304 +0100
@@ -1295,8 +1295,7 @@
{
int err = 0;
- if ( (xen_start_info.flags & SIF_INITDOMAIN) ||
- (xen_start_info.flags & SIF_NET_BE_DOMAIN) )
+ if ( xen_start_info.flags & SIF_INITDOMAIN )
return 0;
IPRINTK("Initialising virtual ethernet driver.\n");
|