Statistics
| Branch: | Revision:

root / hw / scsi-bus.c @ ae2ebad7

History | View | Annotate | Download (15.5 kB)

# Date Author Comment
2d1fd261 01/24/2011 10:39 pm Stefan Hajnoczi

scsi: Allow scsi_bus_legacy_add_drive() to set removable bit

scsi-disk devices may wish to override the removable bit. Add support
for a qdev property on SCSI devices. This is will be used by usb-msd.

Signed-off-by: Stefan Hajnoczi <>...

db07c0f8 12/11/2010 11:32 pm Gleb Natapov

Add get_fw_dev_path callback to scsi bus.

Signed-off-by: Gleb Natapov <>
Signed-off-by: Blue Swirl <>

a6d96eb7 11/25/2010 01:19 pm Hannes Reinecke

scsi: Move sense handling into the driver

The current sense handling in scsi-bus is only used by the
scsi-disk driver; the scsi-generic driver is using its own.
So we should move the current sense handling into the
scsi-disk driver.

Signed-off-by: Hannes Reinecke <>...

622b520f 11/25/2010 12:57 pm Hannes Reinecke

scsi: Increase the number of possible devices

The SCSI parallel interface has a limit of 8 devices, but
not the SCSI stack in general. So we should be removing the
hard-coded limit and use MAX_SCSI_DEVS instead.
And we only need to scan those devices which are allocated...

a5e3d9ef 09/21/2010 04:39 pm Bernhard Kohl

scsi_bus: fix length and xfer_mode for RESERVE and RELEASE commands

For the RESERVE and RELEASE commands the length must be zero
and xfer_mode must be SCSI_XFER_NONE.

Signed-off-by: Bernhard Kohl <>
Signed-off-by: Kevin Wolf <>

2446333c 08/24/2010 06:22 pm Blue Swirl

Rearrange block headers

Changing block.h or blockdev.h resulted in recompiling most objects.

Move DriveInfo typedef and BlockInterfaceType enum definitions
to qemu-common.h and rearrange blockdev.h use to decrease churn.

Signed-off-by: Blue Swirl <>

e8637c90 07/22/2010 06:52 am Jan Kiszka

scsi: Dequeue requests before invoking completion callback

The request completion callback of the LSI controller may start the next
request that can use the same tag as the completed one. As the latter is
still enqueued at that point, scsi_send_command will complain about the...

42e766a2 07/06/2010 06:05 pm Markus Armbruster

scsi: Error locations for -drive if=scsi device initialization

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

f8b6cc00 07/02/2010 02:18 pm Markus Armbruster

qdev: Decouple qdev_prop_drive from DriveInfo

Make the property point to BlockDriverState, cutting out the DriveInfo
middleman. This prepares the ground for block devices that don't have
a DriveInfo.

Currently all user-defined ones have a DriveInfo, because the only way...

18846dee 07/02/2010 02:18 pm Markus Armbruster

block: Catch attempt to attach multiple devices to a blockdev

For instance, -device scsi-disk,drive=foo -device scsi-disk,drive=foo
happily creates two SCSI disks connected to the same block device.
It's all downhill from there.

Device usb-storage deliberately attaches twice to the same blockdev,...

fa66b909 07/02/2010 02:18 pm Markus Armbruster

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

01bedeba 06/22/2010 03:38 pm Nicholas Bellinger

scsi-bus: Add PERSISTENT_RESERVE_OUT SCSIRequest->cmd.mode setup

This patch updates hw/scsi-bus.c to add the PERSISTENT_RESERVE_OUT cdb
case in scsi_req_xfer_mode() to set SCSI_XFER_TO_DEV for outgoing WRITE data.

Signed-off-by: Nicholas A. Bellinger <>...

c7126d5b 06/22/2010 03:38 pm Nicholas Bellinger

scsi-bus: Add MAINTENANCE_IN and MAINTENANCE_OUT SCSIRequest xfer and mode assignments

This patch updates hw/scsi-bus.c to add MAINTENANCE_IN and MAINTENANCE_OUT case in
scsi_req_length() for TYPE_ROM with MMC commands. It also adds the MAINTENANCE_OUT
case in scsi_req_xfer_mode() to set SCSI_XFER_TO_DEV for outgoing write data....

666daa68 06/04/2010 04:20 pm Markus Armbruster

blockdev: Collect block device code in new blockdev.c

Anything that moves hundreds of lines out of vl.c can't be all bad.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

1ecda02b 03/16/2010 05:58 pm Markus Armbruster

error: Replace qemu_error() by error_report()

error_report() terminates the message with a newline. Strip it it
from its arguments.

This fixes a few error messages lacking a newline:
net_handle_fd_param()'s "No file descriptor named %s found", and
tap_open()'s "vnet_hdr=1 requested, but no kernel support for...

2f792016 03/16/2010 05:55 pm Markus Armbruster

error: Move qemu_error & friends into their own header

545557d4 12/25/2009 06:11 pm Blue Swirl

scsi: fix Sparse warning: Initializer entry defined twice

Both REWIND and REZERO_UNIT use 0x01, READ_POSITION and PRE_FETCH
share 0x34.

Signed-off-by: Blue Swirl <>

38215553 12/03/2009 05:41 pm Gerd Hoffmann

scsi-disk: restruct emulation: GET_CONFIGURATION

Move GET_CONFIGURATION emulation from scsi_send_command() to
scsi_disk_emulate_command().

Also add GET_CONFIGURATION to scsi-defs.h and scsi_command_name().

Signed-off-by: Gerd Hoffmann <>...

5dd90e2a 12/03/2009 05:41 pm Gerd Hoffmann

scsi-disk: restruct emulation: SERVICE_ACTION_IN

Move SERVICE_ACTION_IN emulation from scsi_send_command() to
scsi_disk_emulate_command().

Also add SERVICE_ACTION_IN to scsi-defs.h and scsi_command_name().

Signed-off-by: Gerd Hoffmann <>...

39ec9a50 12/03/2009 05:41 pm Gerd Hoffmann

scsi-disk: restruct emulation: REPORT_LUNS

Move REPORT_LUNS emulation from scsi_send_command() to
scsi_disk_emulate_command().

Also add REPORT_LUNS to scsi-defs.h and scsi_command_name().

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

bd536cf3 12/03/2009 05:41 pm Gerd Hoffmann

scsi: add read/write 16 commands.

Add READ_16 + friends to scsi-defs.h, scsi_command_name() and the
request parsing helper functions.

Use them in scsi-disk.c too.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

ec766865 12/03/2009 05:41 pm Gerd Hoffmann

scsi: add scsi_req_print()

Handy for debugging.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

97a06435 12/03/2009 05:41 pm Gerd Hoffmann

scsi: add xfer mode

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

37659e51 12/03/2009 05:41 pm Gerd Hoffmann

scsi: move sense to SCSIDevice, create SCSISense struct.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

ed3a34a3 12/03/2009 05:41 pm Gerd Hoffmann

scsi: move status to SCSIRequest.

Also add and use the scsi_req_complete() helper function for calling the
completion callback.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

9af99d98 12/03/2009 05:41 pm Gerd Hoffmann

scsi: move request lists to QTAILQ.

Changes: * Move from open-coded lists to QTAILQ macros. * Move the struct elements to the common data structures
(SCSIDevice + SCSIRequest). * Drop free request pools. * Fix request cleanup in the destroy callback....

89b08ae1 12/03/2009 05:41 pm Gerd Hoffmann

scsi: move SCSIRequest management to common code.

Create generic functions to allocate, find and release SCSIRequest
structs. Make scsi-disk and scsi-generic use them.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

2ec749cb 12/03/2009 05:41 pm Gerd Hoffmann

scsi: add request parsing helpers to common code.

Add helper functions for scsi request parsing to common code. Getting
command length, transfer size, and linear block address is handled.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

43b443b6 11/09/2009 04:43 pm Gerd Hoffmann

scsi: move scsi-disk.h -> scsi.h

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

33e66b86 10/07/2009 04:54 pm Markus Armbruster

Check return value of qdev_init()

But do so only where it may actually fail. Leave the rest for the
next commit.

Patchworks-ID: 35167
Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

cb23117b 10/05/2009 05:32 pm Gerd Hoffmann

scsi: hotplug windup

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

01985dcf 10/05/2009 05:32 pm Gerd Hoffmann

Implement scsi device destruction

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

ca9c39fa 10/05/2009 05:32 pm Gerd Hoffmann

switch scsi bus to inplace allocation.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

d52affa7 09/09/2009 10:57 pm Gerd Hoffmann

qdev/scsi: add scsi bus support to qdev, convert drivers.

  • Add SCSIBus. * Add SCSIDeviceInfo, move device callbacks here. * add qdev/scsi helper functions. * convert drivers.

Adding scsi disks via -device works now, i.e. you can do:

-drive id=sda,if=none,......