]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Support setting the 'removable' flag for USB disks
authorFred A. Kemp <anonym@riseup.net>
Fri, 23 Aug 2013 10:38:11 +0000 (12:38 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 2 Sep 2013 12:45:38 +0000 (14:45 +0200)
commitfeba2febce4719a2f15b8d4823c2093c2d066314
tree640534bfb674ddd647e7acb11d8c3a36dc22fd53
parent071249771b7a5b04c391865afb189ccbfe37d917
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@redhat.com>
13 files changed:
docs/formatdomain.html.in
docs/schemas/domaincommon.rng
src/conf/domain_conf.c
src/conf/domain_conf.h
src/qemu/qemu_capabilities.c
src/qemu/qemu_capabilities.h
src/qemu/qemu_command.c
tests/qemuhelpdata/qemu-1.2.0-device
tests/qemuhelpdata/qemu-kvm-1.2.0-device
tests/qemuhelptest.c
tests/qemuxml2argvdata/qemuxml2argv-disk-usb-device-removable.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-disk-usb-device-removable.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c