libvirt/src/qemu
Laine Stump 177db08775 qemu: add new disk device='lun' for bus='virtio' & type='block'
In the past, generic SCSI commands issued from a guest to a virtio
disk were always passed through to the underlying disk by qemu, and
the kernel would also pass them on.

As a result of CVE-2011-4127 (see:
http://seclists.org/oss-sec/2011/q4/536), qemu now honors its
scsi=on|off device option for virtio-blk-pci (which enables/disables
passthrough of generic SCSI commands), and the kernel will only allow
the commands for physical devices (not for partitions or logical
volumes). The default behavior of qemu is still to allow sending
generic SCSI commands to physical disks that are presented to a guest
as virtio-blk-pci devices, but libvirt prefers to disable those
commands in the standard virtio block devices, enabling it only when
specifically requested (hopefully indicating that the requester
understands what they're asking for). For this purpose, a new libvirt
disk device type (device='lun') has been created.

device='lun' is identical to the default device='disk', except that:

1) It is only allowed if bus='virtio', type='block', and the qemu
   version is "new enough" to support it ("new enough" == qemu 0.11 or
   better), otherwise the domain will fail to start and a
   CONFIG_UNSUPPORTED error will be logged).

2) The option "scsi=on" will be added to the -device arg to allow
   SG_IO commands (if device !='lun', "scsi=off" will be added to the
   -device arg so that SG_IO commands are specifically forbidden).

Guests which continue to use disk device='disk' (the default) will no
longer be able to use SG_IO commands on the disk; those that have
their disk device changed to device='lun' will still be able to use SG_IO
commands.

*docs/formatdomain.html.in - document the new device attribute value.
*docs/schemas/domaincommon.rng - allow it in the RNG
*tests/* - update the args of several existing tests to add scsi=off, and
 add one new test that will test scsi=on.
*src/conf/domain_conf.c - update domain XML parser and formatter

*src/qemu/qemu_(command|driver|hotplug).c - treat
 VIR_DOMAIN_DISK_DEVICE_LUN *almost* identically to
 VIR_DOMAIN_DISK_DEVICE_DISK, except as indicated above.

Note that no support for this new device value was added to any
hypervisor drivers other than qemu, because it's unclear what it might
mean (if anything) to those drivers.
2012-01-09 10:55:53 -05:00
..
libvirtd_qemu.aug qemu: Support for overriding NOFILE limit 2011-12-22 17:49:04 +01:00
MIGRATION.txt qemu: Implement migration job phases 2011-07-27 08:45:09 -06:00
qemu_bridge_filter.c Remove conn parameter from virReportSystemError 2010-02-09 01:04:54 +01:00
qemu_bridge_filter.h build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
qemu_capabilities.c qemu: add capabilities flags related to SG_IO 2012-01-09 10:55:44 -05:00
qemu_capabilities.h qemu: add capabilities flags related to SG_IO 2012-01-09 10:55:44 -05:00
qemu_cgroup.c use cpuset to manage numa 2011-12-20 09:32:23 -07:00
qemu_cgroup.h qemu: Implement period and quota tunable XML configuration and parsing 2011-07-21 17:11:12 +08:00
qemu_command.c qemu: add new disk device='lun' for bus='virtio' & type='block' 2012-01-09 10:55:53 -05:00
qemu_command.h qemu: Prepare to cater for more general address assignment 2011-12-09 15:01:52 -07:00
qemu_conf.c qemu: Support for overriding NOFILE limit 2011-12-22 17:49:04 +01:00
qemu_conf.h qemu: Keep list of USB devices attached to domains 2011-12-24 18:12:04 +01:00
qemu_domain.c config: report error when script given for inappropriate interface type 2012-01-08 10:52:24 -05:00
qemu_domain.h Fix default migration speed in qemu driver 2011-12-15 11:25:07 -07:00
qemu_driver.c qemu: add new disk device='lun' for bus='virtio' & type='block' 2012-01-09 10:55:53 -05:00
qemu_driver.h Split all QEMU process mangement code into separate file 2011-02-17 12:48:55 +00:00
qemu_hostdev.c qemu: Keep list of USB devices attached to domains 2011-12-24 18:12:04 +01:00
qemu_hostdev.h qemu: Keep list of USB devices attached to domains 2011-12-24 18:12:04 +01:00
qemu_hotplug.c qemu: add new disk device='lun' for bus='virtio' & type='block' 2012-01-09 10:55:53 -05:00
qemu_hotplug.h qemu: Don't drop hostdev config until security label restore 2011-12-16 11:53:03 +01:00
qemu_migration.c migration: Add more specific error code/message on migration abort 2011-12-16 16:38:26 +01:00
qemu_migration.h Clarify semantics of virDomainMigrate2 2011-10-14 22:04:31 +02:00
qemu_monitor_json.c Fix typos in messages. 2012-01-03 20:30:33 -07:00
qemu_monitor_json.h Implement virDomain{Set, Get}BlockIoTune for the qemu driver 2011-11-30 11:36:10 -07:00
qemu_monitor_text.c Implement virDomain{Set, Get}BlockIoTune for the qemu driver 2011-11-30 11:36:10 -07:00
qemu_monitor_text.h Implement virDomain{Set, Get}BlockIoTune for the qemu driver 2011-11-30 11:36:10 -07:00
qemu_monitor.c qemu: Fix race between async and query jobs 2011-12-15 11:53:20 +01:00
qemu_monitor.h Implement virDomain{Set, Get}BlockIoTune for the qemu driver 2011-11-30 11:36:10 -07:00
qemu_process.c qemu: Support for overriding NOFILE limit 2011-12-22 17:49:04 +01:00
qemu_process.h Rename Macvtap management APIs 2011-11-18 16:10:01 +00:00
qemu.conf qemu: Support for overriding NOFILE limit 2011-12-22 17:49:04 +01:00
test_libvirtd_qemu.aug qemu: Support for overriding NOFILE limit 2011-12-22 17:49:04 +01:00
THREADS.txt qemu: fix crash when mixing sync and async monitor jobs 2011-08-01 09:41:57 -06:00