[Qemu-devel] [PATCH v2 02/21] scsi-generic: Remove bogus double complete

2011-05-16 Thread Paolo Bonzini
scsi-generic scsi_read_complete() should not -both- call the client complete callback with SCSI_REASON_DATA -and- call scsi_command_complete(). The former will cause the client to queue a new read or write request, while the later will free the request data structure, thus causing the new read or

[Qemu-devel] [PATCH v2 03/21] scsi: introduce scsi_req_data

2011-05-16 Thread Paolo Bonzini
This abstracts calling the command_complete callback, reducing churn in the following patches. Signed-off-by: Paolo Bonzini --- hw/scsi-bus.c |6 ++ hw/scsi-disk.c|8 hw/scsi-generic.c |6 +++--- hw/scsi.h |1 + trace-events |1 + 5 files cha

Re: [Qemu-devel] KVM call agenda for May 17th

2011-05-16 Thread Paolo Bonzini
On 05/16/2011 12:07 PM, Juan Quintela wrote: From two weeks ago, we have already: - import kvm headers into qemu, drop #ifdef maze (Jan) SCSI patches merge plan Paolo

[Qemu-devel] [PATCH v2 01/21] scsi: add tracing of scsi requests

2011-05-16 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- hw/scsi-bus.c |6 ++ trace-events |6 ++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index ceeb4ec..0fd85fc 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -4,6 +4,7 @@ #include "scsi-defs.h" #

[Qemu-devel] [PATCH v2 11/21] scsi: use scsi_req_complete

2011-05-16 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- hw/scsi-generic.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c index 5bfbb8a..e1f8a8a 100644 --- a/hw/scsi-generic.c +++ b/hw/scsi-generic.c @@ -288,7 +288,6 @@ static int32_t scsi_send_command(

[Qemu-devel] [PATCH v2 06/21] lsi: extract lsi_find_by_tag

2011-05-16 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- hw/lsi53c895a.c | 63 +- 1 files changed, 38 insertions(+), 25 deletions(-) diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c index ccea6ad..3b67155 100644 --- a/hw/lsi53c895a.c +++ b/hw/lsi53c895a.c @@ -652,38 +

[Qemu-devel] [PATCH v2 14/21] scsi: introduce scsi_req_new

2011-05-16 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- hw/esp.c |2 +- hw/lsi53c895a.c |3 +-- hw/scsi-bus.c|5 + hw/scsi.h|1 + hw/spapr_vscsi.c |2 +- hw/usb-msd.c |2 +- 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/hw/esp.c b/hw/esp.c index 3a6

[Qemu-devel] [PATCH v2 04/21] scsi: introduce SCSIBusOps

2011-05-16 Thread 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

[Qemu-devel] [PATCH v2 12/21] scsi: Update sense code handling

2011-05-16 Thread Paolo Bonzini
From: 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

[Qemu-devel] [PATCH v2 21/21] scsi: split command_complete callback in two

2011-05-16 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- hw/esp.c | 60 +--- hw/lsi53c895a.c | 48 +++--- hw/scsi-bus.c|4 +- hw/scsi.h|9 + hw/spapr_vscsi.c | 101 ++ hw/usb-msd.c

[Qemu-devel] [PATCH v2 07/21] scsi: Use 'SCSIRequest' directly

2011-05-16 Thread Paolo Bonzini
From: 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.

[Qemu-devel] [PATCH v2 05/21] scsi: reference-count requests

2011-05-16 Thread 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 wit

[Qemu-devel] [PATCH v2 16/21] scsi: introduce scsi_req_get_buf

2011-05-16 Thread Paolo Bonzini
... and remove some SCSIDevice variables or fields that now become unused. Signed-off-by: Paolo Bonzini --- hw/esp.c |2 +- hw/lsi53c895a.c |2 +- hw/scsi-bus.c|5 + hw/scsi.h|1 + hw/spapr_vscsi.c |8 ++-- hw/usb-msd.c |2 +- 6 files chan

Re: [Qemu-devel] [PATCH 2/2] libcacard: add libcacard.la target

2011-05-16 Thread Paolo Bonzini
On 05/16/2011 02:14 PM, Alon Levy wrote: On Mon, May 16, 2011 at 02:07:55PM +0200, Paolo Bonzini wrote: On 05/16/2011 02:06 PM, Gerd Hoffmann wrote: Usually programs that are fully autoconf-iscated will ship a subset of libtool sources in the tarball, build a custom version at configure time, a

[Qemu-devel] [PATCH v2 10/21] scsi: introduce scsi_req_cancel

2011-05-16 Thread 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: Paolo Bonzini --- hw/esp.c | 16 ++-- hw/lsi53c895a.c | 30 +- hw/

[Qemu-devel] [PATCH v2 09/21] scsi: introduce scsi_req_abort

2011-05-16 Thread Paolo Bonzini
This covers the case of canceling a request's I/O and still completing it. Signed-off-by: Paolo Bonzini --- hw/scsi-bus.c|9 + hw/scsi.h|1 + hw/spapr_vscsi.c |8 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/hw/scsi-bus.c b/hw/scsi-bus.

[Qemu-devel] [PATCH v2 19/21] scsi: make write_data return void

2011-05-16 Thread Paolo Bonzini
The return value is unused anyway. Signed-off-by: Paolo Bonzini --- hw/scsi-disk.c|6 ++ hw/scsi-generic.c |7 ++- hw/scsi.h |2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 65744c7..4c7a53e 100644 --- a/

[Qemu-devel] [PATCH v2 13/21] scsi: do not call send_command directly

2011-05-16 Thread Paolo Bonzini
Move the common part of scsi-disk.c and scsi-generic.c to the SCSI layer. Signed-off-by: Paolo Bonzini --- hw/esp.c |2 +- hw/lsi53c895a.c |2 +- hw/scsi-bus.c |3 ++- hw/scsi-disk.c|1 - hw/scsi-generic.c |1 - hw/scsi.h |2 +- hw/spapr_vscsi.c

[Qemu-devel] [PATCH v2 08/21] scsi: commonize purging requests

2011-05-16 Thread 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: Paolo Bonzini --- hw/scsi-bus.c | 12 hw/scsi-disk.c| 18 ++ hw/scsi-generic.c | 18 ++ hw/scsi.h |1 + 4

[Qemu-devel] [PATCH v2 20/21] scsi-generic: Handle queue full

2011-05-16 Thread Paolo Bonzini
The sg driver currently has a hardcoded limit of commands it can handle simultaneously. When this limit is reached the driver will return -EDOM. So we need to capture this to enable proper return values here. Signed-off-by: Hannes Reinecke Signed-off-by: Paolo Bonzini --- hw/scsi-generic.c |

[Qemu-devel] [PATCH v2 17/21] scsi: Implement 'get_sense' callback

2011-05-16 Thread Paolo Bonzini
From: Hannes Reinecke 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 Signed-off-by: Paolo Bonzini --- hw/scsi-bus.c |9 +++

[Qemu-devel] [PATCH v2 15/21] scsi: introduce scsi_req_kick

2011-05-16 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- hw/esp.c | 26 ++ hw/lsi53c895a.c | 22 -- hw/scsi-bus.c| 10 ++ hw/scsi.h|1 + hw/spapr_vscsi.c | 26 ++ hw/usb-msd.c | 15 --- trace-ev

[Qemu-devel] [PATCH v2 18/21] scsi-disk: add data direction checking

2011-05-16 Thread Paolo Bonzini
From: Hannes Reinecke scsi_req_parse() already provides for a data direction setting, so we should be using it to check for correct direction. And we should return the sense code 'INVALID FIELD IN CDB' in these cases. Signed-off-by: Hannes Reinecke Signed-off-by: Paolo Bonzini --- hw/scsi-dis

<    1   2