Statistics
| Branch: | Revision:

root / hw / scsi-bus.c @ fa2ddcb4

History | View | Annotate | Download (52.8 kB)

# Date Author Comment
a5cf8262 10/05/2012 03:58 pm Jim Meyering

scsi, pci, qdev, isa-bus, sysbus: don't let *_get_fw_dev_path return NULL

Use g_strdup rather than strdup, because the sole caller
(qdev_get_fw_dev_path_helper) assumes it gets non-NULL, and dereferences
it. Besides, in that caller, the allocated buffer is already freed with...

bb729f75 09/21/2012 05:14 pm Paolo Bonzini

scsi: introduce scsi_cdb_length and scsi_data_cdb_length

Signed-off-by: Paolo Bonzini <>

d83c951c 08/18/2012 11:50 am Gerd Hoffmann

scsi: fix warning

hw/scsi-bus.c:758: warning: ‘xfer’ may be used uninitialized in this
function

Isn't true, but older gcc versions (for example 4.1 as shipped in rhel5)
are not clever enougth to figure, so sprinkle in a default: line to make
them happy....

832a226b 08/09/2012 09:34 pm Blue Swirl

scsi-bus: remove overlapping entry

LOAD_UNLOAD and START_STOP have same value, so the table
entry is initialized twice. Spotted by Clang compiler.

Remove LOAD_UNLOAD entry since START_STOP entry already
represents both.

Reviewed-by: Markus Armbruster <>...

e4b65262 08/03/2012 10:55 pm Cong Meng

scsi: add support for ATA_PASSTHROUGH_xx scsi command

Correct the command names of opcode 0x85 and 0xa1, and calculate
their xfer size from CDB.

Signed-off-by: Cong Meng <>
Signed-off-by: Paolo Bonzini <>

93161b69 08/03/2012 11:01 am Ronnie Sahlberg

SCSI: Update the sense code for PREVENT REMOVAL errors

Change the sense codes for failures to eject a device that is locked
by PREVENT_ALLOW_MEDIUM_REMOVAL from
the generic MEDIA_LOAD_OR_EJECT_FAILED to the more specific
MEDIUM_REMOVAL_PREVENTED.

The second sense code is more accurate, and is also listed in MMC annex F...

aaebacef 07/27/2012 09:25 am Paolo Bonzini

scsi-disk: report resized disk via sense codes

Linux will not use these, but a very similar mechanism will be used to
report the condition via virtio-scsi events.

Signed-off-by: Paolo Bonzini <>

53200fad 07/27/2012 09:25 am Paolo Bonzini

scsi: report parameter changes to HBA drivers

Signed-off-by: Paolo Bonzini <>

350e6e41 07/27/2012 09:25 am Cong Meng

scsi: introduce hotplug() and hot_unplug() interfaces for SCSI bus

Add two interfaces hotplug() and hot_unplug() to scsi bus info.
The scsi bus can implement these two interfaces to signal the HBA driver
of guest kernel to add/remove the scsi device in question....

e48e84ea 07/27/2012 09:25 am Paolo Bonzini

scsi: establish precedence levels for unit attention

When a device is resized, we will report a unit attention condition
for CAPACITY DATA HAS CHANGED. However, we should ensure that this
condition does not override a more important unit attention condition....

814589c4 07/27/2012 09:25 am Paolo Bonzini

scsi: add tracepoint for scsi_req_cancel

Signed-off-by: Paolo Bonzini <>

6a8a685c 07/26/2012 06:44 pm Ronnie Sahlberg

scsi-disk: Fail medium writes with proper sense for readonly LUNs

Add sense code for DATA_PROTECT/WRITE_PROTECTED and return this error
for any WRITE*/WRITE_VERIFY* calls if the device is readonly=on,
i.e. write-protected

Signed-off-by: Ronnie Sahlberg <>...

380feaff 07/26/2012 06:44 pm Paolo Bonzini

scsi-disk: parse MODE SELECT commands and parameters

This adds the bulk of the parsing code for MODE SELECT, including
breaking out changes to different mode pages, and checking that only
changeable values are modified.

In order to report errors correctly two passes are made through the...

8e86b93c 07/10/2012 02:35 pm Paolo Bonzini

scsi: add free_request callback

Most device models have a simple lifecycle for the hba_private field
and they can free it when a request is completed or cancelled.
However, in some cases it may be simpler to tie the lifetime
of hba_private to that of the included SCSIRequest. This patch...

335f560f 07/02/2012 12:27 pm Christian Hoff

scsi: Fix data length == SCSI_SENSE_BUF_SIZE

Fix the edge case where the sense data length is exactly the same
as SCSI_SENSE_BUF_SIZE.
This makes SCSI requests work that use all of the available 95 byte
sense data.

Signed-off-by: Christian Hoff <>...

15e58a21 07/02/2012 12:27 pm Christian Hoff

scsi: Fix LOAD_UNLOAD

Change operation code of LOAD_UNLOAD command to 0x1b as described in
section 7.3 of the SCSI Stream Commands spec.

Signed-off-by: Christian Hoff <>
Signed-off-by: Christian Borntraeger <>...

28b70c9d 07/02/2012 12:27 pm Paolo Bonzini

scsi: Ensure command and transfer lengths are set for all SCSI devices

scsi-generic relies on those values to be correct, so it is important that
those values are initialized properly for all device types.

Reported-by: Christian Hoff <>...

40723a99 07/02/2012 12:27 pm Christian Hoff

scsi: Add basic support for SCSI media changer commands.

This adds basic support for SCSI media changer commands.
Not all commands are supported as of now, but enough to cover
basic functionality.

Signed-off-by: Christian Hoff <>...

9ce1bb2d 07/02/2012 12:27 pm Christian Hoff

scsi: Fix transfer length for READ POSITION commands.

The transfer length depends on the specific service action
code, as defined in the SCSI stream commands spec section 7.7.
Up to now only the extended form was supported.

Signed-off-by: Christian Hoff <>...

93bfef4c 06/19/2012 09:36 pm Crístian Viana

Allow machines to configure the QEMU_VERSION that's exposed via hardware

QEMU exposes its version to the guest's hardware and in some cases that is wrong
(e.g. Windows prints messages about driver updates when you switch
the QEMU version).
There is a new field now on the struct QEmuMachine, hw_version, which may...

09e5ab63 06/18/2012 04:14 pm Anthony Liguori

qdev: Use wrapper for qdev_get_path

This makes it easier to remove it from BusInfo.

Signed-off-by: Anthony Liguori <>
Signed-off-by: Paolo Bonzini <>
[AF: Drop now unnecessary NULL initialization in scsibus_get_dev_path()]...

0d936928 06/18/2012 04:14 pm Anthony Liguori

qdev: Convert busses to QEMU Object Model

This is far less interesting than it sounds. We simply add an Object to each
BusState and then register the types appropriately. Most of the interesting
refactoring will follow in the next patches.

Since we're changing fundamental type names (BusInfo -> BusClass), it all needs...

0866aca1 06/18/2012 04:14 pm Anthony Liguori

qbus: Make child devices links

Make qbus children show up as link<> properties. There is no stable
addressing for qbus children so we use an unstable naming convention.

This is okay in QOM though because the composition name is expected to
be what's stable....

8cb6789a 06/18/2012 04:14 pm Paolo Bonzini

qdev: Remove qdev_prop_exists()

Can be replaced everywhere with object_property_find().

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Andreas Färber <>

89bfe000 06/18/2012 04:14 pm Paolo Bonzini

qom: Push error reporting to object_property_find()

Avoids duplicated error_set().

Signed-off-by: Paolo Bonzini <>
[AF: Also drop error_set() in object_property_del().]
Signed-off-by: Andreas Färber <>

3cb75a7c 06/18/2012 04:14 pm Paolo Bonzini

qdev: Move bus properties to a separate global

Simple code movement in order to simplify future refactoring.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Andreas Färber <>

bce54474 06/18/2012 04:14 pm Paolo Bonzini

qdev: Move bus properties to abstract superclasses

In qdev, each bus in practice identified an abstract superclass, but
this was mostly hidden. In QOM, instead, these abstract classes are
explicit so we can move bus properties there.

All bus property walks are removed, and all device property walks...

18eef3bc 06/07/2012 11:02 am Gerd Hoffmann

scsi: prepare migration code for usb-storage support

usb-storage can't handle requests in one go as the data transfer can be
splitted into lots of usb packets. Because of that there can be
normal in-flight requests at savevm time and we need to handle that....

12badfc2 05/25/2012 02:00 pm Jim Meyering

scsi: declare vmstate_info_scsi_requests to be static

Signed-off-by: Jim Meyering <>

065c2599 05/07/2012 09:44 am Paolo Bonzini

scsi: parse 16-byte tape CDBs

The transfer length for these commands is different from the transfer
length of the corresponding disk commands, so parse it specially.

Signed-off-by: Paolo Bonzini <>

3c3d8a95 05/07/2012 09:44 am Paolo Bonzini

scsi: do not require a minimum allocation length for INQUIRY

The requirements on the INQUIRY buffer size are not in my copy of SPC
(SPC-4 r27) and not observed by LIO. Rip them out.

Signed-off-by: Paolo Bonzini <>

e5f38ff6 05/07/2012 09:44 am Paolo Bonzini

scsi: do not require a minimum allocation length for REQUEST SENSE

The requirements on the REQUEST SENSE buffer size are not in my copy of SPC
(SPC-4 r27) and not observed by LIO. Rip them out.

Signed-off-by: Paolo Bonzini <>

77e4743c 05/07/2012 09:44 am Paolo Bonzini

scsi: set VALID bit to 0 in fixed format sense data

The INFORMATION field (bytes 3..6) is never set by QEMU, so the VALID
bit must be 0.

Signed-off-by: Paolo Bonzini <>

68bd348a 05/07/2012 09:44 am Stefan Weil

scsi: Add assertion for use-after-free errors

The QEMU emulation which is currently used with Raspberry PI images
(qemu-system-arm -M versatilepb ...) accesses memory which was freed.

Valgrind output (extract):

17857 Invalid write of size 4
17857 at 0x24EB06: scsi_req_unref (scsi-bus.c:1273)...
f62d0594 05/07/2012 09:44 am Paolo Bonzini

scsi: do not report bogus overruns for commands in the 0x00-0x1F range

Interpreting cdb4 == 0 as a request to transfer 256 blocks is only
needed for READ_6 and WRITE_6. No other command in that range needs
that special-casing, and the resulting overrun breaks scsi-testsuite's...

a5ee9085 05/04/2012 11:39 am Paolo Bonzini

scsi: fix WRITE SAME transfer length and direction

Signed-off-by: Paolo Bonzini <>

381b634c 05/04/2012 11:39 am Ronnie Sahlberg

scsi: Specify the xfer direction for UNMAP and ATA_PASSTHROUGH commands

scsi_cmd_xfer_mode() is used to specify the xfer direction for SCSI
commands that come in from the guest. If the direction is set incorrectly
this will eventually cause QEMU to kernel-panic the guest....

12a08998 05/04/2012 11:39 am Paolo Bonzini

scsi: prevent data transfer overflow

Avoid sending more than 2GB of data, as that can cause overflows
in int32_t variables.

Signed-off-by: Paolo Bonzini <>

3e46d87d 04/19/2012 05:26 pm Paolo Bonzini

scsi: add SANITIZE command

Signed-off-by: Paolo Bonzini <>

b7c8c35f 04/19/2012 11:31 am Paolo Bonzini

scsi: fix memory leak

scsibus_get_dev_path is leaking id if it is not NULL. Fix it.

Reported-by: Laszlo Ersek <>
Signed-off-by: Paolo Bonzini <>

baa1bd89 03/19/2012 05:35 pm Paolo Bonzini

scsi: add get_dev_path

Signed-off-by: Paolo Bonzini <>

9fac25bf 02/24/2012 03:54 pm Paolo Bonzini

scsi: fix wrong return for target INQUIRY

Signed-off-by: Paolo Bonzini <>

d3d250bd 02/24/2012 03:54 pm Paolo Bonzini

scsi: fix searching for an empty id

The conditions for detecting no free target or LUN were wrong.

The LUN loop was followed by an "if" condition that is never
true, because the loop is exited as soon as lun becomes equal
to bus->info->max_lun, and never becomes greater than it....

3d5aba97 02/22/2012 02:29 pm Paolo Bonzini

scsi: add scatter/gather functionality

Scatter/gather functionality uses the newly added DMA helpers. The
device can choose between doing DMA itself, or calling scsi_req_data
as usual, which will use the newly added DMA helpers to copy piecewise
to/from the destination area(s)....

5d0d2467 02/22/2012 02:29 pm Paolo Bonzini

scsi-disk: enable scatter/gather functionality

Signed-off-by: Paolo Bonzini <>

63f740dd 02/22/2012 02:29 pm Paolo Bonzini

scsi: add SCSIDevice vmstate definitions

Signed-off-by: Paolo Bonzini <>

01e95455 02/22/2012 02:29 pm Paolo Bonzini

scsi: pass residual amount to command_complete

With the upcoming sglist support, HBAs will not see any transfer_data
call and will not have a way to detect short transfers. So pass the
residual amount of data upon command completion.

Signed-off-by: Paolo Bonzini <>

83f7d43a 02/15/2012 05:39 pm Andreas Färber

qom: Unify type registration

Replace device_init() with generalized type_init().

While at it, unify naming convention: type_init([$prefix_]register_types)
Also, type_init() is a function, so add preceding blank line where
necessary and don't put a semicolon after the closing brace....

39bffca2 02/03/2012 06:41 pm Anthony Liguori

qdev: register all types natively through QEMU Object Model

This was done in a mostly automated fashion. I did it in three steps and then
rebased it into a single step which avoids repeatedly touching every file in
the tree.

The first step was a sed-based addition of the parent type to the subclass...

d307af79 02/03/2012 06:41 pm Anthony Liguori

qdev: kill off DeviceInfo

It is no longer used in the tree since everything is done natively through
QEMU Object Model.

Signed-off-by: Anthony Liguori <>

b9eea3e6 01/27/2012 06:50 pm Anthony Liguori

scsi: convert to QEMU Object Model

Signed-off-by: Anthony Liguori <>

ce4e7e46 11/22/2011 11:33 am Paolo Bonzini

usb-msd: do not register twice in the boot order

USB mass storage devices are registered twice in the boot order.
To avoid having to keep the two paths in sync, pass the bootindex
property down to the scsi-disk device and let it register itself.

Signed-off-by: Paolo Bonzini <>...

795928f6 11/22/2011 11:33 am Paolo Bonzini

scsi: fix fw path

The pre-1.0 firmware path for SCSI devices already included the LUN
using the suffix argument to add_boot_device_path. Avoid that it is
included twice, and convert the colons to commas for consistency with
other kinds of devices

Signed-off-by: Paolo Bonzini <>...

f3b338ef 11/18/2011 03:12 pm Paolo Bonzini

scsi: pass down REQUEST SENSE to the device when there is no stored sense

This will let scsi-block/scsi-generic report progress on long
operations.

Reported-by: Thomas Schmitt <>
Tested-by: Thomas Schmitt <>...

06b86357 11/18/2011 03:04 pm Paolo Bonzini

scsi: fix parsing of allocation length field

- several MMC commands were parsed wrong by QEMU because their allocation
length/parameter list length is placed in a non-standard position in
the CDB (i.e. it is different from most commands with the same value in...

00a01ad4 11/18/2011 02:57 pm Paolo Bonzini

scsi: update list of commands

Add more commands and their names, and remove SEEK which is obsolete.
Instead, use SET_CAPACITY which is still in SSC.

Tested-by: Thomas Schmitt <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

7082826e 11/18/2011 02:35 pm Paolo Bonzini

scsi: fix fw path

The pre-1.0 firmware path for SCSI devices already included the LUN
using the suffix argument to add_boot_device_path. I missed that when
making channel and LUN customizable. Avoid that it is included twice, and
convert the colons to commas for consistency with other kinds of devices...

adcf2754 10/28/2011 08:25 pm Paolo Bonzini

scsi: make reqops const

Also delete a stale occurrence of SCSIReqOps inside SCSIDeviceInfo.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

63db0f0e 10/28/2011 08:25 pm Paolo Bonzini

scsi: pass cdb to alloc_req

This will let scsi-block choose between passthrough and emulation.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

e88c591d 10/28/2011 08:25 pm Paolo Bonzini

scsi: do not call transfer_data after canceling a request

Otherwise, if cancellation is "faked" by the AIO layer and goes
through qemu_aio_flush, the whole request is completed synchronously
during scsi_req_cancel.

Using the enqueued flag would work here, but not in the next patches,...

71544d30 10/28/2011 08:25 pm Paolo Bonzini

scsi: push request restart to SCSIDevice

The request restart mechanism is generic and could be reused for
scsi-generic. In the meanwhile, pushing it to SCSIDevice avoids
that scsi_dma_restart_bh looks at SCSIGenericReqs when working on
a scsi-block device....

afd4030c 10/28/2011 08:25 pm Paolo Bonzini

scsi: move tcq/ndev to SCSIBusOps (now SCSIBusInfo)

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

f48a7a6e 10/28/2011 08:25 pm Paolo Bonzini

scsi: remove devs array from SCSIBus

Change the devs array into a linked list, and add a scsi_device_find
function to navigate the children list instead. This lets the SCSI
bus use more complex addressing, and HBAs can talk to the correct device
when there are multiple LUNs per target....

ba74307c 10/28/2011 08:25 pm Paolo Bonzini

scsi: implement REPORT LUNS for arbitrary LUNs

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

7e0380b9 10/28/2011 08:25 pm Paolo Bonzini

scsi: allow arbitrary LUNs

This only requires changes in two places: in SCSIBus, we need to look
for a free LUN if somebody creates a device with a pre-existing scsi-id
but the default LUN (-1, meaning "search for a free spot"); in vSCSI,
we need to actually parse the LUN according to the SCSI spec....

0d3545e7 10/28/2011 08:25 pm Paolo Bonzini

scsi: add channel to addressing

This also requires little more than adding the new argument to
scsi_device_find, and the qdev property. All devices by default
end up on channel 0.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

67cc61e4 10/28/2011 08:25 pm Paolo Bonzini

atapi/scsi: unify definitions for MMC

The definitions in ide/internal.h are duplicates, since ATAPI commands
actually come from SCSI. Use the ones in scsi-defs.h and move the
missing ones there. Two exceptions:

- MODE_PAGE_WRITE_PARMS conflicts with the "flexible disk geometry"...

3653d8c4 10/28/2011 08:25 pm Paolo Bonzini

scsi: notify the device when unit attention is reported

Reporting media change events via unit attention sense codes requires
a small state machine: first report "NO MEDIUM", then report "MEDIUM MAY
HAVE CHANGED". Unfortunately there is no good hooking point for the...

8a9c16f6 10/28/2011 08:25 pm Paolo Bonzini

scsi-disk: report media changed via unit attention sense codes

Building on the previous patch, this one adds a media change callback
to scsi-disk.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

bd5da232 09/20/2011 01:27 pm Paolo Bonzini

scsi: fix sign extension problems

When assigning a 32-bit value to cmd->xfer (which is 64-bits)
it can be erroneously sign extended because the intermediate
32-bit computation is signed. Fix this by standardizing on
the ld*_be_p functions.

Signed-off-by: Paolo Bonzini <>...

68bb01f3 09/12/2011 04:17 pm Markus Armbruster

scsi-disk: Fix START_STOP to fail when it can't eject

Don't fail when tray is already open.

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

48bb9f53 09/10/2011 05:48 pm Blue Swirl

scsi-bus: remove duplicate table entries

Remove duplicate entries from SCSI command table, spotted by
clang analyzer:
/src/qemu/hw/scsi-bus.c:979:40: warning: initializer overrides prior initialization of this subobject
[ ERASE_16 ] = "ERASE_16",...

eae31cb9 09/06/2011 04:28 pm Paolo Bonzini

scsi: fill in additional sense length correctly

Even though we do not use them, we should include the last three
bytes of sense data in the additional sense length.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

f6515262 09/06/2011 04:14 pm Paolo Bonzini

scsi: refine constants for READ CAPACITY 16

Rename SERVICE_ACTION_IN to SERVICE_ACTION_IN_16 to distinguish
from the 12-byte CDB variant, and add a constant for the subcommand.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

7267c094 08/21/2011 07:01 am Anthony Liguori

Use glib memory allocation and free functions

qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <>

8b2a04ee 08/16/2011 10:11 pm Paolo Bonzini

scsi: do not overwrite memory on REQUEST SENSE commands with a large buffer

Other scsi_target_reqops commands were careful about not using r->cmd.xfer
directly, and instead always cap it to a fixed length. This was not done
for REQUEST SENSE, and this patch fixes it....

3b6ffe50 08/14/2011 10:34 pm Peter Maydell

hw/scsi-bus.c: Fix use of uninitialised variable

Don't use req before it has been initialised in scsi_req_new().
This fixes a compile failure due to gcc complaining about this.

Signed-off-by: Peter Maydell <>
Acked-by: Paolo Bonzini <>...

6dc06f08 08/12/2011 04:31 pm Paolo Bonzini

scsi: add support for unit attention conditions

Unit attention conditions override any sense data the device already
has. Their signaling and clearing is handled entirely by the SCSIBus
code, and they are completely transparent to the SCSIDevices.

Signed-off-by: Paolo Bonzini <>...

c7b48872 08/12/2011 04:31 pm Paolo Bonzini

scsi: report unit attention on reset

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

98254542 08/12/2011 04:31 pm Paolo Bonzini

scsi: add special traces for common commands

Can be useful when debugging the device scan phase.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

739df215 08/12/2011 04:31 pm Paolo Bonzini

scsi: move handling of REQUEST SENSE to common code

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

a872a304 08/12/2011 04:31 pm Paolo Bonzini

scsi: add a bunch more common sense codes

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

fdaef069 08/12/2011 04:30 pm Paolo Bonzini

scsi: move handling of REPORT LUNS and invalid LUNs to common code

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

2599aece 08/12/2011 04:29 pm Paolo Bonzini

scsi: introduce SCSICommand

This struct is currently unnamed. Give it a name and use it
explicitly to decouple (some parts of) CDB parsing from
SCSIRequest.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

87dcd1b2 08/12/2011 04:29 pm Paolo Bonzini

scsi: push lun field to SCSIDevice

This will let SCSIBus detect requests sent to an invalid LUN, and
handle them itself. However, there will be still support for only one
LUN per target

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

afa46c46 08/12/2011 04:29 pm Paolo Bonzini

scsi: move request parsing to common code

Also introduce the first occurrence of "independent" SCSIReqOps,
to handle invalid commands in common code.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

12010e7b 08/12/2011 04:27 pm Paolo Bonzini

scsi: move request-related callbacks from SCSIDeviceInfo to SCSIReqOps

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

c39ce112 08/12/2011 04:27 pm Paolo Bonzini

scsi: pass cdb already to scsi_req_new

Right now the CDB is not passed to the SCSIBus until scsi_req_enqueue.
Passing it to scsi_req_new will let scsi_req_new dispatch common requests
through different reqops.

Moving the memcpy to scsi_req_new is a hack that will go away as...

8dbd4574 08/12/2011 04:27 pm Paolo Bonzini

scsi: introduce SCSIReqOps

This will let allow requests to be dispatched through different callbacks,
either common or per-device.

This patch adjusts the API, the next one will move members to SCSIReqOps.

Signed-off-by: Paolo Bonzini <>...

b45ef674 08/12/2011 04:27 pm Paolo Bonzini

scsi: move sense handling to generic code

With this patch, sense data is stored in the generic data structures
for SCSI devices and requests. The SCSI layer takes care of storing
sense data in the SCSIDevice for the subsequent REQUEST SENSE command.

At the same time, get_sense is removed and scsi_req_get_sense can use...

682a9b21 08/12/2011 04:27 pm Paolo Bonzini

scsi: pass status when completing

A small improvement in the SCSI request API. Pass the status
at the time the request is completed, so that we can assert that
no request is completed twice. This would have detected the
problem fixed in the previous patch....

645a8ad6 08/11/2011 04:37 pm Zhi Yong Wu

scsi-bus: use DO_UPCAST

Signed-off-by: Zhi Yong Wu <>
Reviewed-by: Markus Armbruster <>
Signed-off-by: Stefan Hajnoczi <>

3790372c 08/01/2011 01:10 pm Hannes Reinecke

scsi: Remove references to SET_WINDOW

SET_WINDOW command is vendor-specific only.
So we shouldn't try to emulate it.

Signed-off-by: Hannes Reinecke <>
Signed-off-by: Kevin Wolf <>

8bd3e139 08/01/2011 01:10 pm Hannes Reinecke

scsi: Remove REZERO_UNIT emulation

REZERO_UNIT command is obsolete. Remove support for it.

Signed-off-by: Hannes Reinecke <>
Signed-off-by: Kevin Wolf <>

5e30a07d 08/01/2011 01:10 pm Hannes Reinecke

scsi: Sanitize command definitions

Sanitize SCSI command definitions.
Add _10 suffix to READ_CAPACITY, WRITE_VERIFY, VERIFY, READ_LONG,
WRITE_LONG, and WRITE_SAME.
Add new command definitions for LOCATE_10, UNMAP, VARLENGTH_CDB,
WRITE_FILEMARKS_16, EXTENDED_COPY, ATA_PASSTHROUGH, ACCESS_CONTROL_IN,...

c5bf71a9 07/19/2011 04:38 pm Hannes Reinecke

scsi: Add 'hba_private' to SCSIRequest

'tag' is just an abstraction to identify the command
from the driver. So we should make that explicit by
replacing 'tag' with a driver-defined pointer 'hba_private'.
This saves the lookup for driver handling several commands...

d800040f 06/05/2011 06:05 pm Paolo Bonzini

scsi: fix tracing of scsi requests with simple backend

The simple backend only supports a maximum of 6 arguments. Split the
scsi_req_parsed event in two parts to cope with the limit.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Blue Swirl <>

c6df7102 05/26/2011 01:14 pm Paolo Bonzini

scsi: split command_complete callback in two

Signed-off-by: Paolo Bonzini <>
Cc: Christoph Hellwig <>

0c34459b 05/26/2011 01:14 pm Paolo Bonzini

scsi: introduce scsi_req_get_buf

... and remove some SCSIDevice variables or fields that now become unused.

Signed-off-by: Paolo Bonzini <>
Reviewed-by: Christoph Hellwig <>

74382217 05/26/2011 01:14 pm Hannes Reinecke

scsi: Implement 'get_sense' callback

The get_sense callback copies existing sense information into
the provided buffer. This is required if sense information
should be transferred together with the command response.

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