History | View | Annotate | Download (15.4 kB)
scsi: make write_data return void
The return value is unused anyway.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Christoph Hellwig <hch@lst.de>
scsi-generic: Handle queue full
The sg driver currently has a hardcoded limit of commands itcan handle simultaneously. When this limit is reached thedriver will return -EDOM. So we need to capture this toenable proper return values here.
Signed-off-by: Hannes Reinecke <hare@suse.de>...
scsi: ignore LUN field in the CDB
The LUN field in the CDB is a historical relic. Ignore it as reserved,which is what modern SCSI specifications actually say.
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 errorwhich is actually a violation of the spec in certain cases....
scsi: do not call send_command directly
Move the common part of scsi-disk.c and scsi-generic.c to the SCSI layer.
scsi: Implement 'get_sense' callback
The get_sense callback copies existing sense information intothe provided buffer. This is required if sense informationshould be transferred together with the command response.
scsi: reference-count requests
With the next patch, a device may hold SCSIRequest for an indefinitetime. 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...
scsi: Use 'SCSIRequest' directly
Currently the SCSIRequest structure is abstracted away and cannot accesseddirectly from the driver. This requires the handler to do a lookup onan abstract 'tag' which identifies the SCSIRequest structure.
With this patch the SCSIRequest structure is exposed to the driver. This...
scsi: commonize purging requests
The code for canceling requests upon reset is already the same. Cleanit up and move it to scsi-bus.c.
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 devicesregister a second callback in SCSIBusOps.
scsi: use scsi_req_complete
scsi-generic: Remove bogus double complete
scsi-generic scsi_read_complete() should not both call the clientcomplete callback with SCSI_REASON_DATA and callscsi_command_complete(). The former will cause the client to queue anew read or write request, while the later will free the request data...
scsi: introduce scsi_req_data
This abstracts calling the command_complete callback, reducing churnin the following patches.
scsi: introduce SCSIBusOps
There are more operations than a SCSI bus can handle, besides completingcommands. One example, which this series will introduce, is cleaning upafter a request is cancelled.
More long term, a "SCSI bus" can represent the LUNs attached to a...
scsi-generic: do not use a stale aiocb
If a request is canceled after it has been completed, scsi_cancel_iowould pass a stale aiocb to bdrv_aio_cancel. Avoid this.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Cc: Christoph Hellwig <hch@lst.de>
scsi: Return SAM status codes
Traditionally, the linux stack is using SCSI status codeswhich are shifted by one as compared to those defined in SAM.A SCSI emulation should naturally return the SAM defined codes,not the linux ones.So to avoid any confusion this patch modifies the existing...
scsi-generic: add missing reset handler
Ensure that pending requests of a SCSI generic device are purged onsystem reset. This also avoids calling a NULL function in lsi53c895a.The lsi code was recently changed to call the .qdev.reset function.
Signed-off-by: Bernhard Kohl <bernhard.kohl@nsn.com>...
scsi: fix and improve debug prints
Some of them are not compile clean.
Signed-off-by: Bernhard Kohl <bernhard.kohl@nsn.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Rearrange block headers
Changing block.h or blockdev.h resulted in recompiling most objects.
Move DriveInfo typedef and BlockInterfaceType enum definitionsto qemu-common.h and rearrange blockdev.h use to decrease churn.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
scsi: Reject unimplemented error actions
drive_init() doesn't permit rerror for if=scsi, but that's worthless:we get it via if=none and -device.
Moreover, scsi-generic doesn't support werror. Since drive_init()doesn't catch that, option werror was silently ignored even with...
qdev: Decouple qdev_prop_drive from DriveInfo
Make the property point to BlockDriverState, cutting out the DriveInfomiddleman. This prepares the ground for block devices that don't havea DriveInfo.
Currently all user-defined ones have a DriveInfo, because the only way...
block: Fix virtual media change for if=none
BlockDriverState member removable controls whether virtual mediachange (monitor commands change, eject) is allowed. It is set whenthe "type hint" is BDRV_TYPE_CDROM or BDRV_TYPE_FLOPPY.
The type hint is only set by drive_init(). It sets BDRV_TYPE_FLOPPY...
blockdev: Clean up automatic drive deletion
We automatically delete blockdev host parts on unplug of the guestdevice. Too much magic, but we can't change that now.
The delete happens early in the guest device teardown, before theconnection to the host part is severed. Thus, the guest part's...
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 <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
error: Replace qemu_error() by error_report()
error_report() terminates the message with a newline. Strip it itfrom its arguments.
This fixes a few error messages lacking a newline:net_handle_fd_param()'s "No file descriptor named %s found", andtap_open()'s "vnet_hdr=1 requested, but no kernel support for...
error: Move qemu_error & friends into their own header
block: add topology qdev properties
Add three new qdev properties to export block topology information tothe guest. This is needed to get optimal I/O alignment for RAID arraysor SSDs.
The options are:
- physical_block_size to specify the physical block size of the device,...
scsi: add xfer mode
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
scsi: move dinfo to SCSIDevice
scsi: move status to SCSIRequest.
Also add and use the scsi_req_complete() helper function for calling thecompletion callback.
scsi: create common SCSIRequest structure.
Rename the SCSIRequest structs in scsi-disk.c and scsi-generic.c toSCSIDiskReq and SCSIGenericReq. Create a SCSIRequest struct and movethe common elements over.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
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....
scsi: move SCSIRequest management to common code.
Create generic functions to allocate, find and release SCSIRequeststructs. Make scsi-disk and scsi-generic use them.
scsi: move scsi command buffer from SCSIGenericReq to SCSIRequest.
scsi: move blocksize from SCSIGenericState to SCSIDevice
scsi: add scsi-defs.h
Largely based on <scsi/scsi.h> from linux. Added into the tree so wecan use the defines everywhere, not just in scsi-generic.c (which islinux-specific).
scsi: move type from SCSIGenericState to SCSIDevice
scsi: add request parsing helpers to common code.
Add helper functions for scsi request parsing to common code. Gettingcommand length, transfer size, and linear block address is handled.
Fix qemu_free use in scsi-generic.c
scsi-generic.c is using free() instead of qemu_free().Fix it.
Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
scsi: move scsi-disk.h -> scsi.h
drive cleanup fixes.
Changes: * drive_uninit() wants a DriveInfo now. * drive_uninit() also calls bdrv_delete(), so callers don't need to do that. * drive_uninit() calls are moved over to the ->exit() callbacks, destroy_bdrvs() is zapped. * setting bdrv->private is not needed any more as the...
Implement scsi device destruction
qdev/scsi: add scsi bus support to qdev, convert drivers.
Adding scsi disks via -device works now, i.e. you can do:
-drive id=sda,if=none,......
Replace gcc variadic macro extension with C99 version
new scsi-generic abstraction, use SG_IO (Christoph Hellwig)
Okay, I started looking into how to handle scsi-generic I/O in thenew world order.
I think the best is to use the SG_IO ioctl instead of the read/writeinterface as that allows us to support scsi passthrough on disk/cdrom...
Add specialized block driver scsi generic API (Avi Kivity)
When a scsi device is backed by a scsi generic device instead of anordinary host block device, the block API is abused in a couple of annoyingways:
- nb_sectors is negative, and specifies a byte count instead of a sector count...
scsi-generic: correct error management
this patch allows to fully use a tape device connected to qemu throughthe scsi-generic interface.
Previous patch introduced tape SCSI commands management, this oneimprove error case management:
- the SCSI controller command completion must be called with the status...
scsi-generic: decode correctly SCSI tape commands (Laurent Vivier)
This patch allows to use a "real" SCSI tape with qemu using"-drive /dev/sgX,if=scsi".
It allows to decode correctly transfer length when the type of thedevice is a tape.
Some issues remain when the application reading the tape tries to go...
scsi-generic: correct 6-bytes commands transfer length (Laurent Vivier)
According to SCSI documentation, for 6 bytes commands (READ,WRITE), if transfer length is 0 it specifies 256 blocks.
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...
scsi-generic: correct usage of memset() (Laurent Vivier)
void *memset(void *s, int c, size_t n);
DESCRIPTION The memset() function fills the first n bytes of thememory area pointed to by s with the constant byte c."
Reported by Dietmar Maurer....
suppress a couple of spurious warnings in scsi-generic.c
This patch fixes two spurious `may be used uninitialised' warningswhen compiling with some compilers.
Signed-off-by: Andre Przywara <andre.przywara@amd.com>Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>...
scsi-generic implemnentation, missing in last commit.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3852 c046a42c-6fe2-441c-8c8c-71466251a162