- 26 5月, 2011 12 次提交
-
-
由 Paolo Bonzini 提交于
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Cc: Christoph Hellwig <hch@lst.de>
-
由 Paolo Bonzini 提交于
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Reviewed-by: NChristoph Hellwig <hch@lst.de>
-
由 Paolo Bonzini 提交于
Move the common part of scsi-disk.c and scsi-generic.c to the SCSI layer. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Reviewed-by: NChristoph Hellwig <hch@lst.de>
-
由 Hannes Reinecke 提交于
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. This patch introduces various predefined sense codes to have the sense code reporting more in line with the spec. On top of Hannes's patch I fixed the reply to REQUEST SENSE commands with DESC=0 and a small (<18) length. Signed-off-by: NHannes Reinecke <hare@suse.de> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Reviewed-by: NChristoph Hellwig <hch@lst.de>
-
由 Paolo Bonzini 提交于
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: NPaolo Bonzini <pbonzini@redhat.com> Reviewed-by: NChristoph Hellwig <hch@lst.de>
-
由 Paolo Bonzini 提交于
This covers the case of canceling a request's I/O and still completing it. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Reviewed-by: NChristoph Hellwig <hch@lst.de>
-
由 Paolo Bonzini 提交于
The code for canceling requests upon reset is already the same. Clean it up and move it to scsi-bus.c. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Reviewed-by: NChristoph Hellwig <hch@lst.de>
-
由 Hannes Reinecke 提交于
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 allows use to use it directly as an argument to the SCSIDeviceInfo callback functions and remove the lookup. A new callback function 'alloc_req' is introduced matching 'free req'; unref'ing to free up resources after use is moved into the scsi_command_complete callbacks. This temporarily introduces a leak of requests that are cancelled, when they are removed from the queue and not from the driver. This is fixed later by introducing scsi_req_cancel. That patch in turn depends on this one, because the argument to scsi_req_cancel is a SCSIRequest. Signed-off-by: NHannes Reinecke <hare@suse.de> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Reviewed-by: NChristoph Hellwig <hch@lst.de>
-
由 Paolo Bonzini 提交于
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 the need to unref the request when it fails. This will go away with the next patches, which move the unref'ing to the devices. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Cc: Christoph Hellwig <hch@lst.de>
-
由 Paolo Bonzini 提交于
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 target; in this case, while all commands will ultimately reach a logical unit, it is the target who is in charge of answering REPORT LUNs. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Cc: Christoph Hellwig <hch@lst.de>
-
由 Paolo Bonzini 提交于
This abstracts calling the command_complete callback, reducing churn in the following patches. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Reviewed-by: NChristoph Hellwig <hch@lst.de>
-
由 Paolo Bonzini 提交于
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Reviewed-by: NChristoph Hellwig <hch@lst.de>
-
- 25 1月, 2011 1 次提交
-
-
由 Stefan Hajnoczi 提交于
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: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 12 12月, 2010 1 次提交
-
-
由 Gleb Natapov 提交于
Signed-off-by: NGleb Natapov <gleb@redhat.com> Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
-
- 25 11月, 2010 2 次提交
-
-
由 Hannes Reinecke 提交于
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: NHannes Reinecke <hare@suse.de> Acked-by: NChristoph Hellwig <hch@lst.de> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
由 Hannes Reinecke 提交于
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 by the bus. Signed-off-by: NHannes Reinecke <hare@suse.de> Acked-by: NChristoph Hellwig <hch@lst.de> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 21 9月, 2010 1 次提交
-
-
由 Bernhard Kohl 提交于
For the RESERVE and RELEASE commands the length must be zero and xfer_mode must be SCSI_XFER_NONE. Signed-off-by: NBernhard Kohl <bernhard.kohl@nsn.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 24 8月, 2010 1 次提交
-
-
由 Blue Swirl 提交于
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: NBlue Swirl <blauwirbel@gmail.com>
-
- 22 7月, 2010 1 次提交
-
-
由 Jan Kiszka 提交于
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 tag reuse and cancel the completed request. That will cause a double free later on when the completion path cleans up as well. Fix this by dequeuing the request before invoking the callback. Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com> Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
-
- 06 7月, 2010 1 次提交
-
-
由 Markus Armbruster 提交于
Signed-off-by: NMarkus Armbruster <armbru@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 02 7月, 2010 3 次提交
-
-
由 Markus Armbruster 提交于
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, which fails with the fix in place. Detach before the second attach there. Also catch attempt to delete while a guest device model is attached. Signed-off-by: NMarkus Armbruster <armbru@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
由 Markus Armbruster 提交于
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 to define one is -drive & friends (they go through drive_init()). DriveInfo is closely tied to -drive, and like -drive, it mixes information about host and guest part of the block device. I'm working towards a new way to define block devices, with clean host/guest separation, and I need to get DriveInfo out of the way for that. Fortunately, the device models are perfectly happy with BlockDriverState, except for two places: ide_drive_initfn() and scsi_disk_initfn() need to check the DriveInfo for a serial number set with legacy -drive serial=... Use drive_get_by_blockdev() there. Device model code should now use DriveInfo only when explicitly dealing with drives defined the old way, i.e. without -device. Signed-off-by: NMarkus Armbruster <armbru@redhat.com> Reviewed-by: NChristoph Hellwig <hch@lst.de> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
由 Markus Armbruster 提交于
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: NMarkus Armbruster <armbru@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 22 6月, 2010 2 次提交
-
-
由 Nicholas Bellinger 提交于
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. Signed-off-by: NNicholas A. Bellinger <nab@linux-iscsi.org> Acked-by: NGerd Hoffmann <kraxel@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
由 Nicholas Bellinger 提交于
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: NNicholas A. Bellinger <nab@linux-iscsi.org> Acked-by: NGerd Hoffmann <kraxel@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 04 6月, 2010 1 次提交
-
-
由 Markus Armbruster 提交于
Anything that moves hundreds of lines out of vl.c can't be all bad. Signed-off-by: NMarkus Armbruster <armbru@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 16 3月, 2010 2 次提交
-
-
由 Markus Armbruster 提交于
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 IFF_VNET_HDR available" (all three versions). There's one place that passes arguments without newlines intentionally: load_vmstate(). Fix it up.
-
由 Markus Armbruster 提交于
-
- 26 12月, 2009 1 次提交
-
-
由 Blue Swirl 提交于
Both REWIND and REZERO_UNIT use 0x01, READ_POSITION and PRE_FETCH share 0x34. Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
-
- 03 12月, 2009 11 次提交
-
-
由 Gerd Hoffmann 提交于
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: NGerd Hoffmann <kraxel@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Gerd Hoffmann 提交于
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: NGerd Hoffmann <kraxel@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Gerd Hoffmann 提交于
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: NGerd Hoffmann <kraxel@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Gerd Hoffmann 提交于
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: NGerd Hoffmann <kraxel@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Gerd Hoffmann 提交于
Handy for debugging. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Gerd Hoffmann 提交于
Also add and use the scsi_req_complete() helper function for calling the completion callback. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Gerd Hoffmann 提交于
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Gerd Hoffmann 提交于
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Gerd Hoffmann 提交于
Add helper functions for scsi request parsing to common code. Getting command length, transfer size, and linear block address is handled. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Gerd Hoffmann 提交于
Create generic functions to allocate, find and release SCSIRequest structs. Make scsi-disk and scsi-generic use them. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Gerd Hoffmann 提交于
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. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-