Hi, all I''ve finished a Xen prototype for virtio transport layer. I would like to make sure it works as expected before I proceed to specific drivers. I''m planning to write simple test backend and dummy front driver. But I have difficulty understanding how Xen front driver (e.g. xen-blkfront) is probed and loaded. Do I just need to setup corresponding xenstore entries and it will work out of the box? Thanks. Wei. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Stefano Stabellini
2011-Jun-24 13:32 UTC
[Xen-devel] Re: How is front driver get probed and loaded?
On Fri, 24 Jun 2011, Wei Liu wrote:> Hi, all > > I''ve finished a Xen prototype for virtio transport layer. I would like > to make sure it works as expected before I proceed to specific > drivers. > > I''m planning to write simple test backend and dummy front driver. But > I have difficulty understanding how Xen front driver (e.g. > xen-blkfront) is probed and loaded. > > Do I just need to setup corresponding xenstore entries and it will > work out of the box?Xen frontend drivers probing and configuration is all done through xenstore. The toolstack writes the initial xenstore entries, then the frontend and the backend fill up the rest. There is a "state" node on xenstore that identifies in which state the frontend and the backend are, where 4 is "connected". I am not sure whether the existing xenstore protocol is going to help you, I would probably try to stay closer to the behaviour of the virtio pci protocol instead. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Fri, Jun 24, 2011 at 9:32 PM, Stefano Stabellini <stefano.stabellini@eu.citrix.com> wrote:> Xen frontend drivers probing and configuration is all done through > xenstore. The toolstack writes the initial xenstore entries, then the > frontend and the backend fill up the rest. > There is a "state" node on xenstore that identifies in which state the > frontend and the backend are, where 4 is "connected". >I understand. What I''m missing is that the key to connect frontend and backend, how do they recognize each other? For example, if I need VBD support, backend will first write "vbd" protocol entries in xenstore. Then domU boots. It reads xenstore and finds "vbd" entries, then it will automatically load xen-blkfront. Is this right?> I am not sure whether the existing xenstore protocol is going to help > you, I would probably try to stay closer to the behaviour of the virtio > pci protocol instead. >By design this transport layer''s behavior resembles virtio pci protocol. Things written to xenstore are only used to connect fe / be transport layers. Lots of work is needed for QEMU backend. Wei. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Stefano Stabellini
2011-Jun-24 13:54 UTC
[Xen-devel] Re: How is front driver get probed and loaded?
On Fri, 24 Jun 2011, Wei Liu wrote:> On Fri, Jun 24, 2011 at 9:32 PM, Stefano Stabellini > <stefano.stabellini@eu.citrix.com> wrote: > > Xen frontend drivers probing and configuration is all done through > > xenstore. The toolstack writes the initial xenstore entries, then the > > frontend and the backend fill up the rest. > > There is a "state" node on xenstore that identifies in which state the > > frontend and the backend are, where 4 is "connected". > > > > I understand. What I''m missing is that the key to connect frontend and > backend, how do they recognize each other? > > For example, if I need VBD support, backend will first write "vbd" > protocol entries in xenstore. Then domU boots. It reads xenstore and > finds "vbd" entries, then it will automatically load xen-blkfront. Is > this right?Close. Libxenlight writes the "vbd" frontend and backend entries: tools/libxl/libxl.c:libxl_device_disk_add the xenbus drivers in the guest reads from xenstore and finds "vbd" so it loads xen-blkfront; the same happens in dom0 with the backend. After that, they establish a connection changing their state from 1 to 2, then from 2 to 3, until they reach 4. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel