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

[Xen-devel] First post-xenbus-change USB patch

To: xen-devel@xxxxxxxxxxxxxxxxxxx, ewan@xxxxxxxxxxxxx
Subject: [Xen-devel] First post-xenbus-change USB patch
From: harry <harry@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 15 Nov 2005 15:23:21 +0000
Delivery-date: Tue, 15 Nov 2005 15:24:49 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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
Here's the first snapshot of the USB code after updating to the new
xenbus.

The xenidc code provides a much higher level of abstraction than the new
xenbus code so the changes didn't affect the usb driver much.

I had to put in empty frontend_changed and backend_changed functions
because the new xenbus code segfaults without them.  The USB code
doesn't need them because the entire state machine and all associated
ring/shared page setup is factored out into the xenidc_endpoint object
and the driver code gets connect and disconnect callbacks from the
endpoint instead.

I'd like the otherend_changed entrypoint to be optional please.  This
will also let me remove the MixedCaps XenbusState typename from my
code :-)

I took the opportunity to implement suspend and resume in the frontend
(and the backend to keep the code equivalent) though this is currently
untested.

I did a quick bit of testing and managed to mount the USB key again etc
but had a few problems with module unload and reload.  I think I maybe
got hit by the unregister_watch deadlock then, after I killed the FE
domain, the new xenbus code gave an error message when I tried to unload
and reload the BE.

I think there must have been some stale state in the store which was
confusing the state machine in the new xenbus code.

I'm using this state machine
http://lists.xensource.com/archives/html/xen-devel/2005-10/msg01199.html
in the xenidc endpoint code.  It is designed to be robust against stale
state left in the store and was working nicely for module load and
unload.

There were a couple of small wins for my code: I could use the otherend
and otherend_id fields from the xenbus_device instead of having my own
and I was able to remove the xenbus_gather from the FE since it doesn't
need any configuration parameters other than the otherend and
otherend_id fields.

The BE still needs to read the USB path so I couldn't remove the gather
from the BE.

Thanks for your offer of help BTW.  Just saw it as I'm writing this :-)

Harry.

Attachment: latest-usb-patch.gz
Description: GNU Zip compressed data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>