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