Skip to contentSkip to conversation

usb storage vitualization

DISCUSSION James Harper 3 participants 4 messages Nov 4, 2004 – Nov 8, 2004

lore
Share & tools
lore
#0 lore raw
Quoted 1 line
Quoted 1 line

If one needed to make a usb storage device usable in a

non-controller

Quoted 5 lines
Quoted 5 lines

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

Quoted 6 lines

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_id065&op=click

#1 lore raw
Quoted 3 lines

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

Quoted 5 lines

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

James

Quoted 9 lines

-------------------------------------------------------
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_id065&op=Click
_______________________________________________
Xen-devel mailing list
[email protected]
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

#2 lore raw

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

Quoted 14 lines · Mark A. Williamson
Quoted 3 lines

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...

Quoted 23 lines

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

Quoted 14 lines

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_id065&op=Click
_______________________________________________
Xen-devel mailing list
[email protected]
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_id065&op=click

#3 lore raw
Quoted 2 lines

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.

Quoted 2 lines

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...

Quoted 2 lines

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

Quoted 40 lines

On Sat, 6 Nov 2004 01:44:25 +0000, Mark A. Williamson

Quoted 36 lines · <[email protected]> wrote:
Quoted 3 lines

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

Quoted 14 lines

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_id065&op=Click
_______________________________________________
Xen-devel mailing list
[email protected]
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_id065&op=click