summaryrefslogtreecommitdiffstats
path: root/hw/scsi.h
diff options
context:
space:
mode:
authorMarkus Armbruster2010-06-25 18:53:21 +0200
committerKevin Wolf2010-07-02 13:18:01 +0200
commitfa66b909f382619da15f8c7e323145adfa94fdac (patch)
treead7e6948ea9eafbd78633a6d14d25cb5c90a88f1 /hw/scsi.h
parentblock: allow filenames with colons again for host devices (diff)
downloadqemu-fa66b909f382619da15f8c7e323145adfa94fdac.tar.gz
qemu-fa66b909f382619da15f8c7e323145adfa94fdac.tar.xz
qemu-fa66b909f382619da15f8c7e323145adfa94fdac.zip
scsi: scsi_bus_legacy_handle_cmdline() can fail, fix callers
None of its callers checks for failure. scsi_hot_add() can crash because of that: (qemu) drive_add 4 if=scsi,format=host_device,file=/dev/sg1 scsi-generic: scsi generic interface too old Segmentation fault (core dumped) Fix all callers, not just scsi_hot_add(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/scsi.h')
-rw-r--r--hw/scsi.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/scsi.h b/hw/scsi.h
index b668e277ae..b1b5f730d5 100644
--- a/hw/scsi.h
+++ b/hw/scsi.h
@@ -98,7 +98,7 @@ static inline SCSIBus *scsi_bus_from_device(SCSIDevice *d)
}
SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, DriveInfo *dinfo, int unit);
-void scsi_bus_legacy_handle_cmdline(SCSIBus *bus);
+int scsi_bus_legacy_handle_cmdline(SCSIBus *bus);
void scsi_dev_clear_sense(SCSIDevice *dev);
void scsi_dev_set_sense(SCSIDevice *dev, uint8_t key);