Statistics
| Branch: | Revision:

root / hw / scsi-bus.c @ 43997225

History | View | Annotate | Download (45 kB)

# Date Author Comment
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 <>

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

scsi: Update sense code handling

The SCSI spec has a quite detailed list of sense codes available.
It even mandates the use of specific ones for some failure cases.
The current implementation just has one type of generic error
which is actually a violation of the spec in certain cases....

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

scsi: do not call send_command directly

Move the common part of scsi-disk.c and scsi-generic.c to the SCSI layer.

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

43a2b339 05/26/2011 01:14 pm Paolo Bonzini

scsi: introduce scsi_req_new

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

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

scsi: introduce scsi_req_continue

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

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

scsi: reference-count requests

With the next patch, a device may hold SCSIRequest for an indefinite
time. Split a rather big patch, and protect against access errors,
by reference counting them.

There is some ugliness in scsi_send_command implementation due to...

5c6c0e51 05/26/2011 01:14 pm Hannes Reinecke

scsi: Use 'SCSIRequest' directly

Currently the SCSIRequest structure is abstracted away and cannot accessed
directly from the driver. This requires the handler to do a lookup on
an abstract 'tag' which identifies the SCSIRequest structure.

With this patch the SCSIRequest structure is exposed to the driver. This...

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

scsi: commonize purging requests

The code for canceling requests upon reset is already the same. Clean
it up and move it to scsi-bus.c.

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

19d110ab 05/26/2011 01:14 pm Paolo Bonzini

scsi: introduce scsi_req_abort

This covers the case of canceling a request's I/O and still
completing it.

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

94d3f98a 05/26/2011 01:14 pm Paolo Bonzini

scsi: introduce scsi_req_cancel

This is for when the request must be dropped in the void,
but still memory should be freed. To this end, the devices
register a second callback in SCSIBusOps.

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

5138efec 05/26/2011 01:14 pm Paolo Bonzini

scsi: add tracing of scsi requests

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

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

scsi: introduce scsi_req_data

This abstracts calling the command_complete callback, reducing churn
in the following patches.

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

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

scsi: introduce SCSIBusOps

There are more operations than a SCSI bus can handle, besides completing
commands. One example, which this series will introduce, is cleaning up
after a request is cancelled.

More long term, a "SCSI bus" can represent the LUNs attached to a...

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