USB MSD are not marked as removable

Reported by Justin M. Forbes on 2010-12-07
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
QEMU
Undecided
Unassigned

Bug Description

 Filed from Fedora bug: https://bugzilla.redhat.com/show_bug.cgi?id=589130

Guests can access USB Mass Storage Device, but fail to mark them as removable.

Changed in qemu:
status: New → Confirmed
Stefan Hajnoczi (stefanha) wrote :

danpb has mentioned that Linux gets this information from SCSI INQUIRY response. So it's up to the USB Mass Storage Device to decide whether or not it wants to have a removable medium.

The SCSI INQUIRY RMB (removable medium bit) tends to be set on modern USB Mass Storage Devices. Of course they don't actually have a removable medium.

One side-effect of setting this bit is that Windows Auto-Run will work if RMB=0 but not work if RMB=0. Also, on RMB=1 devices only the first partition is displayed by Windows - you can't have more than one partition on the device.

For more information, see: http://www.microsoft.com/whdc/connect/usb/usbfaq.mspx

So at the end of the day, it's up to QEMU whether or not to mark USB MSDs as having removable media. Since modern devices tend to set RMB=1, we probably should too.

Stefan Hajnoczi (stefanha) wrote :

"One side-effect of setting this bit is that Windows Auto-Run will work if RMB=0 but not work if RMB=0" should read "but not work if RMB=1".

Stefan Hajnoczi (stefanha) wrote :

A sampling of physical USB devices:
1. Noname 2GB USB stick: RMB=1
2. Nexus One USB storage: RMB=1
3. LaCie USB harddisk: RMB=0

I suspect there's no setting that will satisfy everyone here. It makes sense for a USB harddisk to set RMB=0 because that allows you to put on more than one partition under Windows.

Sebastian Malcolm (smalcolm) wrote :

Stefan, you fixed this in QEMU 24 Jan 2011 so this bug can be marked as Fixed Released?

SEE: http://lists.gnu.org/archive/html/qemu-devel/2011-01/msg02425.html
Append ",removable=on" to a device definition for USB Mass Storage Devices to override the removable bit (but off by default):
> qemu -usb
> -drive if=none,file=test.img,cache=none,id=disk0
> -device usb-storage,drive=disk0,removable=on

However, I cannot see a way to set "removable=on" for usb-storage devices started via libvirt (in 12.04, with libvirt-bin 0.9.8-2ubuntu17.1 and virt-manager 0.9.1-1ubuntu5.1).

So, is a feature request required for virt-manager to expose this option for virtual disks (default to 'on' for bus='usb') and add support to libvirt's XML to set "removable=on" ?

On Mon, Jul 2, 2012 at 4:04 PM, Sebastian Malcolm
<email address hidden> wrote:
> Stefan, you fixed this in QEMU 24 Jan 2011 so this bug can be marked as
> Fixed Released?

Yes

> However, I cannot see a way to set "removable=on" for usb-storage
> devices started via libvirt (in 12.04, with libvirt-bin
> 0.9.8-2ubuntu17.1 and virt-manager 0.9.1-1ubuntu5.1).
>
> So, is a feature request required for virt-manager to expose this option
> for virtual disks (default to 'on' for bus='usb') and add support to
> libvirt's XML to set "removable=on" ?

Yes, I just checked libvirt.git/master and cannot see a way to set the
removable option. I'm afraid libvirt also needs changes.

Stefan

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers