History | View | Annotate | Download (28.4 kB)
vscsi: avoid unwarranted strncpy
Don't use strncpy when the source string is known to fitin the destination buffer. Use equivalent memcpy.We could even use strcpy, here, but some static analyzerswarn about that, so don't add new uses.
Acked-by: David Gibson <david@gibson.dropbear.id.au>...
pseries: Convert sPAPR TCEs to use generic IOMMU infrastructure
The pseries platform already contains an IOMMU implementation, since it isessential for the platform's paravirtualized VIO devices. This IOMMUsupport is currently built into the implementation of the VIO "bus" and...
spapr_vscsi: Error handling fixes
We were incorrectly g_free'ing an object that isn't allocatedin one error path and failed to release it completely in another
This fixes qemu crashes with some cases of IO errors.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>...
pseries: Implement automatic PAPR VIO address allocation
PAPR virtual IO (VIO) devices require a unique, but otherwise arbitrary,"address" used as a token to the hypercalls which manipulate them.
Currently the pseries machine code does an ok job of allocating these...
pseries: Remove old debug leftovers from spapr_vscsi
The PAPR VSCSI emulation contains a few lines of code which were once usedfor debug but now do nothing at all. This patch removes them.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>Signed-off-by: Andreas Färber <afaerber@suse.de>
pseries: Reset vscsi properly
Currently the PAPR vscsi implementation does not properly clear its tableof request tags when the system is reset. This patch adds a reset hookto do so.
scsi: pass residual amount to command_complete
With the upcoming sglist support, HBAs will not see any transfer_datacall and will not have a way to detect short transfers. So pass theresidual amount of data upon command completion.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
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 wherenecessary and don't put a semicolon after the closing brace....
qdev: register all types natively through QEMU Object Model
This was done in a mostly automated fashion. I did it in three steps and thenrebased it into a single step which avoids repeatedly touching every file inthe tree.
The first step was a sed-based addition of the parent type to the subclass...
spapr: convert to QEMU Object Model (v2)
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>---v1 -> v2 - use QOM to check for the default console
qdev: prepare source tree for code conversion
These are various small stylistic changes which help make things moreconsistent such that the automated conversion script can be simpler.
It's not necessary to agree or disagree with these style changes because all...
scsi: move tcq/ndev to SCSIBusOps (now SCSIBusInfo)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
scsi: remove devs array from SCSIBus
Change the devs array into a linked list, and add a scsi_device_findfunction to navigate the children list instead. This lets the SCSIbus use more complex addressing, and HBAs can talk to the correct devicewhen there are multiple LUNs per target....
scsi: allow arbitrary LUNs
This only requires changes in two places: in SCSIBus, we need to lookfor a free LUN if somebody creates a device with a pre-existing scsi-idbut the default LUN (-1, meaning "search for a free spot"); in vSCSI,we need to actually parse the LUN according to the SCSI spec....
scsi: add channel to addressing
This also requires little more than adding the new argument toscsi_device_find, and the qdev property. All devices by defaultend up on channel 0.
vscsi: send the CHECK_CONDITION status down together with autosense data
I introduced this bug in commit 05751d3 (vscsi: always use get_sense,2011-08-03) because at the time there was no way to expose a sensecondition to SLOF and Linux manages to work around the bug. However,...
spapr: proper qdevification
Right now the spapr devices cannot be instantiated with -device,because the IRQs need to be passed to the spapr_*_create functions.Do this instead in the bus's init wrapper.
This is particularly important with the conversion from scsi-disk...
spapr: prepare for qdevification of irq
Restructure common properties for sPAPR devices so that IRQ definitionscan be added in one place.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Cc: Alexander Graf <agraf@suse.de>Cc: David Gibson <david@gibson.dropbear.id.au>...
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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 requeststhrough different reqops.
Moving the memcpy to scsi_req_new is a hack that will go away as...
vscsi: always use get_sense
vscsi supports autosensing by providing sense data directly in theresponse. When get_sense was added, the older state machine approachthat sent REQUEST SENSE commands separately was left in place. Removeit, all existing SCSIDevices do support autosensing and the next patches...
scsi: Add 'hba_private' to SCSIRequest
'tag' is just an abstraction to identify the commandfrom the driver. So we should make that explicit byreplacing 'tag' with a driver-defined pointer 'hba_private'.This saves the lookup for driver handling several commands...
scsi: split command_complete callback in two
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Cc: Christoph Hellwig <hch@lst.de>
scsi: rename arguments to the new callbacks
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 <pbonzini@redhat.com>Reviewed-by: Christoph Hellwig <hch@lst.de>
scsi: introduce scsi_req_new
scsi: introduce scsi_req_continue
scsi: introduce scsi_req_get_buf
... and remove some SCSIDevice variables or fields that now become unused.
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.
Signed-off-by: Hannes Reinecke <hare@suse.de>...
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: introduce scsi_req_abort
This covers the case of canceling a request's I/O and stillcompleting it.
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: 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...
spapr_vscsi: Set uninitialized variable
cppcheck reports this error:
hw/spapr_vscsi.c:274: error: Uninitialized variable: rc
If llen == 0, rc was indeed used without being initialized.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Alexander Graf <agraf@suse.de>
Implement PAPR virtual SCSI interface (ibmvscsi)
This patch implements the infrastructure and hypercalls necessary forthe PAPR specified Virtual SCSI interface. This is the normal methodfor providing (virtual) disks to PAPR partitions.
Signed-off-by: Ben Herrenschmidt <benh@kernel.crashing.org>...