WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Problem creating a new device type

To: Ewan Mellor <ewan@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Problem creating a new device type
From: John L Griffin <jlg@xxxxxxxxxx>
Date: Sat, 12 Nov 2005 16:00:43 -0500
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Sat, 12 Nov 2005 21:00:51 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20051112201906.GI24103@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Ewan's workaround solves my problem.  For the record, here is the 
necessary change in meterif.py:

        def getDeviceDetails(self, config):
                devid = self.allocateDeviceID()
                back = { 'hotplug-status' : 'connected' }
                return (devid, back, {})

By the way, did I miss a page that discusses this on the Xen wiki or on 
this list?  (I'd searched these, but to no avail.)

> You lost me completely.  What is it you want to do?

I'd like to start three domains:
1. dom0 [xen0 kernel]
2. my-backend [xen0 kernel]: the meter backend domain
3. my-frontend-1 [xenU kernel]: connects to my-backend
4. my-frontend-2 [xenU kernel]: connects to my-backend
etc.

In other words, the meter backend functionality will be entirely contained 
in the "my-backend" domain.  My understanding of the "netif", "blkif", and 
"tpmif" domain configuration options is that they're intended for exactly 
this purpose?

Thanks,
JLG



Ewan Mellor <ewan@xxxxxxxxxxxxx> wrote on 11/12/2005 03:19:06 PM:

> On Sat, Nov 12, 2005 at 02:53:10PM -0500, John L Griffin wrote:
> 
> > Howdy xen folks,
> > 
> > I am having trouble creating a new device type (e.g., vif, vbd, vtpm). 
 I 
> > call this new device type "meter".
> > 
> > I'm using an up-to-date xen-unstable tree.  When I start a guest 
domain 
> > (with a "meter" domain configuration option), the startup process 
hangs 
> > for two minutes and produces a "Error: Device 0 (meter) could not be 
> > connected. Hotplug scripts not working" message.  The guest domain is 
then 
> > stuck in the "paused" state until I kill it.
> > 
> > During this, the xenbus successfully probes the backend, and the 
correct 
> > "frontend" and "frontend-id" are available to the backend on the 
xenbus.
> > 
> > I've included the "xm log" error and a summary of the files I've 
modified 
> > below.
> > 
> > My questions are:
> > 
> > 1. Have I left out modifying a necessary file when creating a new 
device 
> > type?
> > 
> > 2. Any ideas as to what could be going on that's preventing my new 
guest 
> > domain from starting?
> 
> It looks like your driver doesn't use any hotplug scripts.  The code in
> DevController expects all drivers to be using hotplug, and to write a 
node
> backend/<deviceClass>/<deviceID>/hotplug-status = connected when the
> hotplugging is complete.
> 
> If you are not going to use hotplug, then the easiest way to work around 
this
> is to write this node yourself by adding it to the backend dictionary 
returned
> from MeterifController.getDeviceDetails.  This will mean that you have 
no
> check that your device is working, but that sounds like exactly what you 
want
> at the moment.
> 
> This check will be changing soon (though not in any major way) so we 
ought to
> be able to accommodate non-hotplug drivers more neatly.
> 
> > 3. Once it's working with dom0 as the backend, will it be possible to 
> > start my backend in a non-dom0 domain, or is the code not to that 
point 
> > yet?
> 
> You lost me completely.  What is it you want to do?
> 
> Ewan.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>