VirtualBox USB Device Capture [PSARC/2009/422 08/12/2009]

2009-08-05 Thread Jerry Gilliam

I am sponsoring this fast-track on behalf of Strony Zhang,
with a timeout set to 08/12/2009.  The project desires
minor release binding.


-jg


--

Template Version: @(#)sac_nextcase 1.68 02/23/09 SMI
This information is Copyright 2009 Sun Microsystems
1. Introduction
   1.1. Project/Component Working Name:
  VirtualBox USB Device Capture
   1.2. Name of Document Author/Supplier:
  Author:  Strony.Zhang
   1.3  Date of This Document:
   04 Aug, 2009

4. Technical Description

Background:
The VirtualBox is a virtualization software product. When VirtualBox
runs on Solaris host OS), it should be able to proxy the USB devices
plugged in the host OS to the guest OS depending on user's
configuration. To achieve this, the VirtualBox needs to control the 
entire USB device completely and ensure the USB device in the pristine
state for guest OS. No driver in host OS should be attached to the
device. Therefore, the VirtualBox team developed a Monitor driver for
capturing devices using the callback and a VirtualBox-specific USB
client driver for transferring data between guest OS and device.

Problem:
When the USB device is plugged in the Solaris system, usba (7D) will
create the compatible names and then attach the corresponding USB client
driver to it by default. During the process, the VirtualBox doesn't have 
a chance to request to attach its own driver to the USB device in which
it is interested.

Solution:
The usba(7D) provides the registration entry to VirtualBox for the
callback and makes the Virtual-specific USB client driver higher
priority than the default USB client driver.  When a USB device is
plugged in the system, the usba(7D) will first call the registered
callback function to query if VirtualBox wants to capture the device.
If yes, the VirtualBox-specific USB client driver will be attached to
the device. Once the VirtualBox exits or user doesn't want to access the 
USB device on guest OS, the VirtualBox will unregister the callback and
then Solaris will take over the USB device taken by VirtualBox.

Interfaces:
The interfaces are Contracted Project Private since they are intended to 
be only used by the VirtualBox.

The following new Interfaces provided by this project:

|---
| Interfaces|  Class.   |   Comments   |
|---
| struct usb_dev_str(9s)|   C.P.P.  |  usb capture device info |
| usb_register_dev_driver(9f)   |   C.P.P   |  usb capture register|
| usb_unregister_dev_driver(9f) |   C.P.P   |  usb capture unregister  |
| usb_dev_driver_callback() |   C.P.P   |  usb capture callback|
|---

They will be available in the .

/*
* getting the device strings of manufacturer, product and serial number
*/
typedef struct usb_dev_str {
char*usb_mfg; /* manufacturer string */
char*usb_product; /* product string */
char*usb_serialno;/* serial number string */
} usb_dev_str_t;

The callback interface is:

/*
* Return Values:
*  USB_SUCCESS - VirtualBox will capture the device
*  USB_FAILURE - VirtualBox will not capture the device
*/
typedef int (*usb_dev_driver_callback)(
usb_dev_descr_t *dev_descr, /* ptr to device descriptor */
usb_dev_str_t   *dev_str,   /* ptr to device strings */
char*path,  /* ptr to physical path */
int bus,/* USB bus address */
int port,   /* USB port number */
char**drv,  /* capture driver name */
void*reserved)
usb_dev_driver_t;

If VirtualBox wants to capture the device, the client driver name
to be attached to the device will be returned by the parameter
(char **drv).

The callback registration and unregistration interfaces are:

int usb_register_dev_driver(dev_info_t *dip, usb_dev_driver_t cb);
void usb_unregister_dev_driver(dev_info_t *dip);

The return value of usb_register_dev_driver() will be USB_SUCCESS
or USB_FAILURE which indicates that the callback registration was
successful or failed.

5. Reference Documents:
PSARC/2000/542 USB Architecture Update project
PSARC/2003/207 USBA2.0: adding USBA interfaces to the DDI

6. Resources and Schedule
6.4. Steering Committee requested information
   6.4.1. Consolidation C-team Name:
   ON
6.5. ARC review type: FastTrack
6.6. ARC Exposure: open





VirtualBox USB Device Capture [PSARC/2009/422 08/12/2009]

2009-08-12 Thread Rick Matthews
+1

Jerry Gilliam wrote:
>
> I am sponsoring this fast-track on behalf of Strony Zhang,
> with a timeout set to 08/12/2009.  The project desires
> minor release binding.
>
>
> -jg
>
>
> --
>
> Template Version: @(#)sac_nextcase 1.68 02/23/09 SMI
> This information is Copyright 2009 Sun Microsystems
> 1. Introduction
>   1.1. Project/Component Working Name:
>  VirtualBox USB Device Capture
>   1.2. Name of Document Author/Supplier:
>  Author:  Strony.Zhang
>   1.3  Date of This Document:
>   04 Aug, 2009
>
> 4. Technical Description
>
> Background:
> The VirtualBox is a virtualization software product. When VirtualBox
> runs on Solaris host OS), it should be able to proxy the USB devices
> plugged in the host OS to the guest OS depending on user's
> configuration. To achieve this, the VirtualBox needs to control the 
> entire USB device completely and ensure the USB device in the pristine
> state for guest OS. No driver in host OS should be attached to the
> device. Therefore, the VirtualBox team developed a Monitor driver for
> capturing devices using the callback and a VirtualBox-specific USB
> client driver for transferring data between guest OS and device.
>
> Problem:
> When the USB device is plugged in the Solaris system, usba (7D) will
> create the compatible names and then attach the corresponding USB client
> driver to it by default. During the process, the VirtualBox doesn't 
> have a chance to request to attach its own driver to the USB device in 
> which
> it is interested.
>
> Solution:
> The usba(7D) provides the registration entry to VirtualBox for the
> callback and makes the Virtual-specific USB client driver higher
> priority than the default USB client driver.  When a USB device is
> plugged in the system, the usba(7D) will first call the registered
> callback function to query if VirtualBox wants to capture the device.
> If yes, the VirtualBox-specific USB client driver will be attached to
> the device. Once the VirtualBox exits or user doesn't want to access 
> the USB device on guest OS, the VirtualBox will unregister the 
> callback and
> then Solaris will take over the USB device taken by VirtualBox.
>
> Interfaces:
> The interfaces are Contracted Project Private since they are intended 
> to be only used by the VirtualBox.
>
> The following new Interfaces provided by this project:
>
> |---
> | Interfaces|  Class.   |   Comments   |
> |---
> | struct usb_dev_str(9s)|   C.P.P.  |  usb capture device info |
> | usb_register_dev_driver(9f)   |   C.P.P   |  usb capture register|
> | usb_unregister_dev_driver(9f) |   C.P.P   |  usb capture unregister  |
> | usb_dev_driver_callback() |   C.P.P   |  usb capture callback|
> |---
>
> They will be available in the .
>
> /*
> * getting the device strings of manufacturer, product and serial number
> */
> typedef struct usb_dev_str {
> char*usb_mfg; /* manufacturer string */
> char*usb_product; /* product string */
> char*usb_serialno;/* serial number string */
> } usb_dev_str_t;
>
> The callback interface is:
>
> /*
> * Return Values:
> *  USB_SUCCESS - VirtualBox will capture the device
> *  USB_FAILURE - VirtualBox will not capture the device
> */
> typedef int (*usb_dev_driver_callback)(
> usb_dev_descr_t*dev_descr,/* ptr to device descriptor */
> usb_dev_str_t*dev_str,/* ptr to device strings */
> char*path,/* ptr to physical path */
> intbus,/* USB bus address */
> intport,/* USB port number */
> char**drv,/* capture driver name */
> void*reserved)
> usb_dev_driver_t;
>
> If VirtualBox wants to capture the device, the client driver name
> to be attached to the device will be returned by the parameter
> (char **drv).
>
> The callback registration and unregistration interfaces are:
>
> int usb_register_dev_driver(dev_info_t *dip, usb_dev_driver_t cb);
> void usb_unregister_dev_driver(dev_info_t *dip);
>
> The return value of usb_register_dev_driver() will be USB_SUCCESS
> or USB_FAILURE which indicates that the callback registration was
> successful or failed.
>
> 5. Reference Documents:
> PSARC/2000/542 USB Architecture Update project
> PSARC/2003/207 USBA2.0: adding USBA interfaces to the DDI
>
> 6. Resources and Schedule
> 6.4. Steering Committee requested information
>   6.4.1. Consolidation C-team Name:
>   ON
> 6.5. ARC review type: FastTrack
> 6.6. ARC Exposure: open
>
>


-- 
-
Rick Matthews   email: Rick.Matthews at sun.com
Sun Microsystems, Inc.   

VirtualBox USB Device Capture [PSARC/2009/422 08/12/2009]

2009-08-12 Thread Andrew Gabriel
Jerry Gilliam wrote:
> 
> I am sponsoring this fast-track on behalf of Strony Zhang,
> with a timeout set to 08/12/2009.  The project desires
> minor release binding.

That means no S10 version, so I guess virtualbox will be designed to 
work on systems both with and without this new interface?

> -jg
> 
> 
> --
> 
> Template Version: @(#)sac_nextcase 1.68 02/23/09 SMI
> This information is Copyright 2009 Sun Microsystems
> 1. Introduction
>   1.1. Project/Component Working Name:
>  VirtualBox USB Device Capture
>   1.2. Name of Document Author/Supplier:
>  Author:  Strony.Zhang
>   1.3  Date of This Document:
>   04 Aug, 2009
> 
> 4. Technical Description

[...]

> Solution:
> The usba(7D) provides the registration entry to VirtualBox for the
> callback and makes the Virtual-specific USB client driver higher
> priority than the default USB client driver.  When a USB device is
> plugged in the system, the usba(7D) will first call the registered
> callback function to query if VirtualBox wants to capture the device.
> If yes, the VirtualBox-specific USB client driver will be attached to
> the device. Once the VirtualBox exits or user doesn't want to access the 
> USB device on guest OS, the VirtualBox will unregister the callback and
> then Solaris will take over the USB device taken by VirtualBox.

This seems to me to be lacking some necessary configuration.
For example, if systems are configured with "exclude: scsa2usb" as a 
matter of site security, it would seem that I could bypass this by using 
virtualbox? Is it sensible to allow virtualbox to take over all USB 
devices without any configurability?

If I plug in a USB device, let's say a memory stick, how does the system 
decide if native Solaris wants to use it, or an OS instance in 
Virtualbox, or which one across potentially several virtualboxes?

-- 
Andrew



VirtualBox USB Device Capture [PSARC/2009/422 08/12/2009]

2009-08-12 Thread Andrew Gabriel
Ramshankar wrote:
> No, VirtualBox will not support USB on S10 hosts then. It would be great 
> if this and another fix (regarding usb_reset_device) went into S10. But 
> we at least require this in Nevada as soon as possible.

My question was rather more will these new versions of virtualbox still 
work with S10 (i.e. will it be implemented so as to not fall over with 
usb_register_dev_driver(9f) not found on S10)?

> If we get the things in S10 we need we'd be more than happy to provide 
> support for S10 as well but right now we don't have them.

If you think there's any chance you might, then you should be looking 
for a patch/micro binding, but that wasn't my question.

-- 
Andrew



VirtualBox USB Device Capture [PSARC/2009/422 08/12/2009]

2009-08-12 Thread Joerg Schilling
Andrew Gabriel  wrote:

> If I plug in a USB device, let's say a memory stick, how does the system 
> decide if native Solaris wants to use it, or an OS instance in 
> Virtualbox, or which one across potentially several virtualboxes?

If you do this with VMware, you first tell vmware to capture e.g. the next USB
memory stick and to forward it.

J?rg

-- 
 EMail:joerg at schily.isdn.cs.tu-berlin.de (home) J?rg Schilling D-13353 Berlin
   js at cs.tu-berlin.de(uni)  
   joerg.schilling at fokus.fraunhofer.de (work) Blog: 
http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily



VirtualBox USB Device Capture [PSARC/2009/422 08/12/2009]

2009-08-12 Thread Andrew Gabriel
Joerg Schilling wrote:
> Andrew Gabriel  wrote:
> 
>> If I plug in a USB device, let's say a memory stick, how does the system 
>> decide if native Solaris wants to use it, or an OS instance in 
>> Virtualbox, or which one across potentially several virtualboxes?
> 
> If you do this with VMware, you first tell vmware to capture e.g. the next USB
> memory stick and to forward it.

That sounds reasonable on a single user system, or a system managed by a 
single manager at a time.

A thought that went through my mind would be to configure specific USB 
ports to belong to specific virtualbox images using cfgadm(1M) or similar.

-- 
Andrew



VirtualBox USB Device Capture [PSARC/2009/422 08/12/2009]

2009-08-12 Thread Ramshankar
No, VirtualBox will not support USB on S10 hosts then. It would be great 
if this and another fix (regarding usb_reset_device) went into S10. But 
we at least require this in Nevada as soon as possible.

If we get the things in S10 we need we'd be more than happy to provide 
support for S10 as well but right now we don't have them.

Regards,
Ram.

Andrew Gabriel wrote:
> Jerry Gilliam wrote:
>>
>> I am sponsoring this fast-track on behalf of Strony Zhang,
>> with a timeout set to 08/12/2009.  The project desires
>> minor release binding.
> 
> That means no S10 version, so I guess virtualbox will be designed to 
> work on systems both with and without this new interface?
> 
>> -jg
>>
>>
>> --
>>
>> Template Version: @(#)sac_nextcase 1.68 02/23/09 SMI
>> This information is Copyright 2009 Sun Microsystems
>> 1. Introduction
>>   1.1. Project/Component Working Name:
>>  VirtualBox USB Device Capture
>>   1.2. Name of Document Author/Supplier:
>>  Author:  Strony.Zhang
>>   1.3  Date of This Document:
>>   04 Aug, 2009
>>
>> 4. Technical Description
> 
> [...]
> 
>> Solution:
>> The usba(7D) provides the registration entry to VirtualBox for the
>> callback and makes the Virtual-specific USB client driver higher
>> priority than the default USB client driver.  When a USB device is
>> plugged in the system, the usba(7D) will first call the registered
>> callback function to query if VirtualBox wants to capture the device.
>> If yes, the VirtualBox-specific USB client driver will be attached to
>> the device. Once the VirtualBox exits or user doesn't want to access 
>> the USB device on guest OS, the VirtualBox will unregister the 
>> callback and
>> then Solaris will take over the USB device taken by VirtualBox.
> 
> This seems to me to be lacking some necessary configuration.
> For example, if systems are configured with "exclude: scsa2usb" as a 
> matter of site security, it would seem that I could bypass this by using 
> virtualbox? Is it sensible to allow virtualbox to take over all USB 
> devices without any configurability?
> 
> If I plug in a USB device, let's say a memory stick, how does the system 
> decide if native Solaris wants to use it, or an OS instance in 
> Virtualbox, or which one across potentially several virtualboxes?
> 



VirtualBox USB Device Capture [PSARC/2009/422 08/12/2009]

2009-08-12 Thread Ramshankar
On Solaris 10 our installer makes sure we don't try and load the USB 
drivers.

VirtualBox will not continue to work on S10 without this functionality.


Andrew Gabriel wrote:
> Ramshankar wrote:
>> No, VirtualBox will not support USB on S10 hosts then. It would be 
>> great if this and another fix (regarding usb_reset_device) went into 
>> S10. But we at least require this in Nevada as soon as possible.
> 
> My question was rather more will these new versions of virtualbox still 
> work with S10 (i.e. will it be implemented so as to not fall over with 
> usb_register_dev_driver(9f) not found on S10)?
> 
>> If we get the things in S10 we need we'd be more than happy to provide 
>> support for S10 as well but right now we don't have them.
> 
> If you think there's any chance you might, then you should be looking 
> for a patch/micro binding, but that wasn't my question.
> 



VirtualBox USB Device Capture [PSARC/2009/422 08/12/2009]

2009-08-12 Thread Ramshankar
VirtualBox *will* continue to work on S10 without this functionality. 
Sorry for that awful typo.

Ramshankar wrote:
> On Solaris 10 our installer makes sure we don't try and load the USB 
> drivers.
> 
> VirtualBox will not continue to work on S10 without this functionality.
> 
> 
> Andrew Gabriel wrote:
>> Ramshankar wrote:
>>> No, VirtualBox will not support USB on S10 hosts then. It would be 
>>> great if this and another fix (regarding usb_reset_device) went into 
>>> S10. But we at least require this in Nevada as soon as possible.
>>
>> My question was rather more will these new versions of virtualbox 
>> still work with S10 (i.e. will it be implemented so as to not fall 
>> over with usb_register_dev_driver(9f) not found on S10)?
>>
>>> If we get the things in S10 we need we'd be more than happy to 
>>> provide support for S10 as well but right now we don't have them.
>>
>> If you think there's any chance you might, then you should be looking 
>> for a patch/micro binding, but that wasn't my question.
>>
> 



VirtualBox USB Device Capture [PSARC/2009/422 08/12/2009]

2009-08-12 Thread Jerry Gilliam

This case was approved today during the weekly PSARC meeting.



-jg