Bug 922495 - Support setting the 'removable' flag for USB disks
Summary: Support setting the 'removable' flag for USB disks
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: All
OS: All
unspecified
unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-17 13:32 UTC by Tails developers
Modified: 2013-09-02 13:44 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-02 13:44:51 UTC
Embargoed:


Attachments (Terms of Use)

Description Tails developers 2013-03-17 13:32:42 UTC
We need an attribute named 'removable' to the target element for
disks, which controls the disk's removable flag.

The intended result is to append 'removable=on' to the '-device' parameter passed to qemu when adding a USB disk via '-disk'. For instance, on a Linux guest it controls the value of /sys/block/$dev/removable.

Beware, this feature should always remains 'off' when running versions of qemu that only support '-usbdevice disk:' for adding USB disks.

This feature probably only makes sense for qemu USB disks.

Comment 1 Peter Krempa 2013-09-02 13:44:51 UTC
This feature was added upstream with:

commit feba2febce4719a2f15b8d4823c2093c2d066314
Author: Fred A. Kemp <anonym>
Date:   Fri Aug 23 12:38:11 2013 +0200

    qemu: Support setting the 'removable' flag for USB disks
    
    Add an attribute named 'removable' to the 'target' element of disks,
    which controls the removable flag. For instance, on a Linux guest it
    controls the value of /sys/block/$dev/removable. This option is only
    valid for USB disks (i.e. bus='usb'), and its default value is 'off',
    which is the same behaviour as before.
    
    To achieve this, 'removable=on' (or 'off') is appended to the '-device
    usb-storage' parameter sent to qemu when adding a USB disk via
    '-disk'. A capability flag QEMU_CAPS_USB_STORAGE_REMOVABLE was added
    to keep track if this option is supported by the qemu version used.
    
    Bug: https://bugzilla.redhat.com/show_bug.cgi?id=922495
    Signed-off-by: Peter Krempa <pkrempa>

commit 071249771b7a5b04c391865afb189ccbfe37d917
Author: Fred A. Kemp <anonym>
Date:   Fri Aug 23 12:38:10 2013 +0200

    qemu: Add capability flag for usb-storage
    
    Allow use of the usb-storage device only if the new capability flag
    QEMU_CAPS_DEVICE_USB_STORAGE is set, which it is for qemu(-kvm)
    versions >= 0.12.1.2-rhel62-beta.
    
    Signed-off-by: Peter Krempa <pkrempa>


Note You need to log in before you can comment on or make changes to this bug.