xemu/hw/scsi
Markus Armbruster c24e7517ee scsi: Fix scsi_bus_legacy_add_drive() scsi-generic with serial
scsi_bus_legacy_add_drive() creates either a scsi-disk or a
scsi-generic device.  It sets property "serial" to argument serial
unless null.  Crashes with scsi-generic, because it doesn't have such
the property.

Only usb_msd_initfn_storage() passes non-null serial.  Reproducer:

    $ qemu-system-x86_64 -nodefaults -display none -S -usb \
    -drive if=none,file=/dev/sg1,id=usb-drv0 \
    -device usb-storage,id=usb-msd0,drive=usb-drv0,serial=123
    qemu-system-x86_64: -device usb-storage,id=usb-msd0,drive=usb-drv0,serial=123: Property '.serial' not found
    Aborted (core dumped)

Fix by handling exactly like "removable": set the property only when
it exists.

Cc: qemu-stable@nongnu.org
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-09-12 08:46:21 +02:00
..
Makefile.objs vhost-scsi: new device supporting the tcm_vhost Linux kernel module 2013-04-19 16:18:11 +02:00
esp-pci.c scsi: Pass size to scsi_bus_new() 2013-08-30 20:14:39 +02:00
esp.c scsi: Pass size to scsi_bus_new() 2013-08-30 20:14:39 +02:00
lsi53c895a.c scsi: Pass size to scsi_bus_new() 2013-08-30 20:14:39 +02:00
megasas.c scsi: Pass size to scsi_bus_new() 2013-08-30 20:14:39 +02:00
mfi.h hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
scsi-bus.c scsi: Fix scsi_bus_legacy_add_drive() scsi-generic with serial 2013-09-12 08:46:21 +02:00
scsi-disk.c scsi-disk: scsi-block device for scsi pass-through should not be removable 2013-06-18 12:43:03 +02:00
scsi-generic.c scsi-generic: check the return value of bdrv_aio_ioctl in execute_command 2013-06-18 12:43:03 +02:00
spapr_vscsi.c spapr-vscsi: add task management 2013-09-12 08:46:21 +02:00
srp.h spapr-vscsi: add task management 2013-09-12 08:46:21 +02:00
vhost-scsi.c devices: Associate devices to their logical category 2013-07-29 10:37:09 -05:00
viosrp.h hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
virtio-scsi.c virtio-scsi: Make type virtio-scsi-common abstract 2013-09-12 08:46:21 +02:00
vmw_pvscsi.c scsi: Pass size to scsi_bus_new() 2013-08-30 20:14:39 +02:00
vmw_pvscsi.h scsi: VMWare PVSCSI paravirtual device implementation 2013-04-19 10:44:17 +02:00