Re: [Qemu-devel] [PATCH 10/16] scsi: move request parsing to common code

2011-08-12 Thread Paolo Bonzini
On 08/12/2011 06:55 PM, Peter Maydell wrote: Does it still make sense to set req->cmd to cmd (and to look at cmd at all) in the case where scsi_req_parse() failed and might not have actually initialised all of cmd? For instance the tracing code (added to scsi_req_new() after this patch) looks at

Re: [Qemu-devel] [PATCH 10/16] scsi: move request parsing to common code

2011-08-12 Thread Paolo Bonzini
On 08/12/2011 06:12 PM, Peter Maydell wrote: This patch makes current master fail to compile with optimisation on: gcc complains: hw/scsi-bus.c: In function ‘scsi_req_new’: hw/scsi-bus.c:375: error: ‘req’ may be used uninitialized in this function because in the 'else' clause we look at req->cm

Re: [Qemu-devel] [PATCH 10/16] scsi: move request parsing to common code

2011-08-12 Thread Peter Maydell
On 3 August 2011 09:49, Paolo Bonzini wrote: > @@ -157,8 +172,22 @@ SCSIRequest *scsi_req_new(SCSIDevice *d, uint32_t tag, > uint32_t lun, >                           uint8_t *buf, void *hba_private) >  { >     SCSIRequest *req; > -    req = d->info->alloc_req(d, tag, lun, hba_private); > -    me

Re: [Qemu-devel] [PATCH 10/16] scsi: move request parsing to common code

2011-08-12 Thread Peter Maydell
On 3 August 2011 09:49, Paolo Bonzini wrote: > @@ -157,8 +172,22 @@ SCSIRequest *scsi_req_new(SCSIDevice *d, uint32_t tag, > uint32_t lun, >                           uint8_t *buf, void *hba_private) >  { >     SCSIRequest *req; > -    req = d->info->alloc_req(d, tag, lun, hba_private); > -    me

[Qemu-devel] [PATCH 10/16] scsi: move request parsing to common code

2011-08-03 Thread Paolo Bonzini
Also introduce the first occurrence of "independent" SCSIReqOps, to handle invalid commands in common code. Signed-off-by: Paolo Bonzini --- hw/scsi-bus.c | 53 ++--- hw/scsi-disk.c|5 - hw/scsi-generic.c |9 - hw/scsi