All of lore.kernel.org
 help / color / mirror / Atom feed
* usb storage vitualization
@ 2004-11-04 21:03 Deepak Manohar
  2004-11-04 21:18 ` Ian Pratt
  0 siblings, 1 reply; 6+ messages in thread
From: Deepak Manohar @ 2004-11-04 21:03 UTC (permalink / raw)
  To: Xen-devel

Hi all,

 If one needed to make a usb storage device usable in a non-controller
domain what would be the best possible technique.

 Can the existing blkfront and blkback drivers be used? 

 Assuming blkback/blkfront can be reused what changes needs to be done on them? 

 Thanks.


Deepak


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: usb storage vitualization
  2004-11-04 21:03 Deepak Manohar
@ 2004-11-04 21:18 ` Ian Pratt
  0 siblings, 0 replies; 6+ messages in thread
From: Ian Pratt @ 2004-11-04 21:18 UTC (permalink / raw)
  To: Deepak Manohar; +Cc: Xen-devel, Ian.Pratt


>  If one needed to make a usb storage device usable in a non-controller
> domain what would be the best possible technique.
> 
>  Can the existing blkfront and blkback drivers be used? 
> 
>  Assuming blkback/blkfront can be reused what changes needs to be done on them? 

Doesn't it just work?

If the USB storage device is present in dom0, I'd expect you to
be able to export it to another domain in the usual way....

Ian


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: usb storage vitualization
@ 2004-11-04 22:46 James Harper
  2004-11-06  1:44 ` Mark A. Williamson
  0 siblings, 1 reply; 6+ messages in thread
From: James Harper @ 2004-11-04 22:46 UTC (permalink / raw)
  To: Ian Pratt, Deepak Manohar; +Cc: Xen-devel

> >  If one needed to make a usb storage device usable in a
non-controller
> > domain what would be the best possible technique.
> >
> >  Can the existing blkfront and blkback drivers be used?
> >
> >  Assuming blkback/blkfront can be reused what changes needs to be
done
> on them?
> 
> Doesn't it just work?
> 
> If the USB storage device is present in dom0, I'd expect you to
> be able to export it to another domain in the usual way....

Does it just work? USB storage devices would probably alter all the time
in terms of their major and minor numbers, and would come and go as hot
pluggable devices do. Maybe udev takes care of all this though.

I ask because i'm interested in doing this too.

James


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_idU88&alloc_id\x12065&op=click

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: usb storage vitualization
  2004-11-04 22:46 usb storage vitualization James Harper
@ 2004-11-06  1:44 ` Mark A. Williamson
  2004-11-08 15:45   ` Deepak Manohar
  0 siblings, 1 reply; 6+ messages in thread
From: Mark A. Williamson @ 2004-11-06  1:44 UTC (permalink / raw)
  To: xen-devel; +Cc: James Harper, Ian Pratt, Deepak Manohar

> Does it just work? USB storage devices would probably alter all the time
> in terms of their major and minor numbers, and would come and go as hot
> pluggable devices do. Maybe udev takes care of all this though.

Weeell, as long as you keep the thing plugged in while you're using it you 
shouldn't have any problems exporting the device like any other block device, 
so in that sense it should work fine.

Unfortunately, as you rightly point out, by the time you've rebooted dom0 and 
plugged / unplugged devices a few times you may find that your USB storage 
device has different major / minor.  On non-udev setups, it's quite possibly 
going to have a different device node altogether, which will mean your config 
file needs updating...

I tend to agree that udev should solve this problem, however, since you'll be 
able to configure that device to always bind to the same device node.  
Whenever you create the domain, it'll look up the major / minor associated 
with that device node and everything should work fine.

Cheers,
Mark

> I ask because i'm interested in doing this too.
>
> James
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Sybase ASE Linux Express Edition - download now for FREE
> LinuxWorld Reader's Choice Award Winner for best database on Linux.
> http://ads.osdn.com/?ad_idU88&alloc_id\x12065&op=Click
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/xen-devel


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: usb storage vitualization
  2004-11-06  1:44 ` Mark A. Williamson
@ 2004-11-08 15:45   ` Deepak Manohar
  2004-11-08 16:56     ` Mark A. Williamson
  0 siblings, 1 reply; 6+ messages in thread
From: Deepak Manohar @ 2004-11-08 15:45 UTC (permalink / raw)
  To: mark.williamson; +Cc: xen-devel, James Harper, Ian Pratt

Mark,

 If I remember correctly - u had mentioned that you had started
working on USB virtualization. How much progress have you made?

 I would be interested in contributing/learning to/from the USB
virtualization project.

 If you have time pls give me some detailed information on how you plan on
virtualizing USB. 

Deepak


On Sat, 6 Nov 2004 01:44:25 +0000, Mark A. Williamson
<mark.williamson@cl.cam.ac.uk> wrote:
> > Does it just work? USB storage devices would probably alter all the time
> > in terms of their major and minor numbers, and would come and go as hot
> > pluggable devices do. Maybe udev takes care of all this though.
> 
> Weeell, as long as you keep the thing plugged in while you're using it you
> shouldn't have any problems exporting the device like any other block device,
> so in that sense it should work fine.
> 
> Unfortunately, as you rightly point out, by the time you've rebooted dom0 and
> plugged / unplugged devices a few times you may find that your USB storage
> device has different major / minor.  On non-udev setups, it's quite possibly
> going to have a different device node altogether, which will mean your config
> file needs updating...
> 
> I tend to agree that udev should solve this problem, however, since you'll be
> able to configure that device to always bind to the same device node.
> Whenever you create the domain, it'll look up the major / minor associated
> with that device node and everything should work fine.
> 
> Cheers,
> Mark
> 
> > I ask because i'm interested in doing this too.
> >
> > James
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by:
> > Sybase ASE Linux Express Edition - download now for FREE
> > LinuxWorld Reader's Choice Award Winner for best database on Linux.
> > http://ads.osdn.com/?ad_idU88&alloc_id\x12065&op=Click
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/xen-devel
>


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_idU88&alloc_id\x12065&op=click

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: usb storage vitualization
  2004-11-08 15:45   ` Deepak Manohar
@ 2004-11-08 16:56     ` Mark A. Williamson
  0 siblings, 0 replies; 6+ messages in thread
From: Mark A. Williamson @ 2004-11-08 16:56 UTC (permalink / raw)
  To: Deepak Manohar; +Cc: xen-devel, James Harper, Ian Pratt

>  If I remember correctly - u had mentioned that you had started
> working on USB virtualization. How much progress have you made?

Got sidetracked by the Xen 2.0 release work.  I'll be back to working on this 
(almost) full time now.

>  I would be interested in contributing/learning to/from the USB
> virtualization project.

I'm planning on making the code available once I have a prototype 
implementation starting to do things...

>  If you have time pls give me some detailed information on how you plan on
> virtualizing USB.

The Linux USB subsystem provides core functionality that is independent of 
platform, device and controller.  Uses two kinds of device drivers:
* Host controller drivers - these talk to the actual USB controller and 
provide services to the core USB code.  These generally use the services 
provided by the PCI core since USB controllers are usually attached to the 
PCI bus.
* USB device drivers - these use the services provided by the USB core in 
order to provide support for a specific device (e.g. USB mass storage, webcam 
foo...)

You can think of it like this:

Things using block / webcam / whatever
-----------------------------------------------------------
USB Client Device Driver (block / webcam / whatever)
-----------------------------------------------------------
USB Core (generic services for client device drivers)
-----------------------------------------------------------
USB Host Controller Driver

I'm writing a Xen Virtual Host Controller driver that will run in unprivileged 
domains.  Instead of talking to a hardware host controller, it'll relay 
requests to a backend USB driver running in dom0.  The backend driver in dom0 
will vet the requests to make sure they are safe and then issue them to the 
device on behalf of the domain.

You can visualise this (use a fixed width font ;-) as follows:

Dom 0                               XenU dom

------------------------            -----------------------
Backend USB driver                   USB Client driver (block / 
(a USB Client Driver to  <----+      webcam / whatever)
rest of dom0 kernel)          |
------------------------      |     -----------------------
USB Core                      |      USB Core
------------------------      |     -----------------------
USB Host Controller           +----> Xen Virtual Host Controller
(talks to real hardware)             (talks to backend using shared memory)


From the XenU kernel's PoV, the Xen Virtual Host Controller looks like any 
other host controller.  However, it's really implemented entirely in software 
- the details of talking to the real host controller are taken care of in 
dom0.

The shared memory interface will be OS agnostic, so BSD etc can hook in their 
own drivers here if they want (the USB subsystem has a similar structure in 
*BSD and probably any sane implementation).  I'm planning to support Linux 
2.4 first, then maybe port to 2.6.

From the user's PoV, you'll be able to say "Give this USB port [on my physical 
host] to this domain." then plug devices into it and the domain should just 
register the device and start using it.

HTH,
Mark

>
> On Sat, 6 Nov 2004 01:44:25 +0000, Mark A. Williamson
>
> <mark.williamson@cl.cam.ac.uk> wrote:
> > > Does it just work? USB storage devices would probably alter all the
> > > time in terms of their major and minor numbers, and would come and go
> > > as hot pluggable devices do. Maybe udev takes care of all this though.
> >
> > Weeell, as long as you keep the thing plugged in while you're using it
> > you shouldn't have any problems exporting the device like any other block
> > device, so in that sense it should work fine.
> >
> > Unfortunately, as you rightly point out, by the time you've rebooted dom0
> > and plugged / unplugged devices a few times you may find that your USB
> > storage device has different major / minor.  On non-udev setups, it's
> > quite possibly going to have a different device node altogether, which
> > will mean your config file needs updating...
> >
> > I tend to agree that udev should solve this problem, however, since
> > you'll be able to configure that device to always bind to the same device
> > node. Whenever you create the domain, it'll look up the major / minor
> > associated with that device node and everything should work fine.
> >
> > Cheers,
> > Mark
> >
> > > I ask because i'm interested in doing this too.
> > >
> > > James
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.Net email is sponsored by:
> > > Sybase ASE Linux Express Edition - download now for FREE
> > > LinuxWorld Reader's Choice Award Winner for best database on Linux.
> > > http://ads.osdn.com/?ad_idU88&alloc_id\x12065&op=Click
> > > _______________________________________________
> > > Xen-devel mailing list
> > > Xen-devel@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/xen-devel


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_idU88&alloc_id\x12065&op=click

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-11-08 16:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-04 22:46 usb storage vitualization James Harper
2004-11-06  1:44 ` Mark A. Williamson
2004-11-08 15:45   ` Deepak Manohar
2004-11-08 16:56     ` Mark A. Williamson
  -- strict thread matches above, loose matches on Subject: below --
2004-11-04 21:03 Deepak Manohar
2004-11-04 21:18 ` Ian Pratt

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.