From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:47146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qrs6s-0005B0-Tu for qemu-devel@nongnu.org; Fri, 12 Aug 2011 09:49:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qrs6r-0001Lk-Ve for qemu-devel@nongnu.org; Fri, 12 Aug 2011 09:49:14 -0400 Received: from mail-gw0-f45.google.com ([74.125.83.45]:61216) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qrs6r-0001Lg-Rv for qemu-devel@nongnu.org; Fri, 12 Aug 2011 09:49:13 -0400 Received: by gwb19 with SMTP id 19so2307429gwb.4 for ; Fri, 12 Aug 2011 06:49:13 -0700 (PDT) Message-ID: <4E452F55.3010704@codemonkey.ws> Date: Fri, 12 Aug 2011 08:49:09 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1312361359-15445-1-git-send-email-pbonzini@redhat.com> In-Reply-To: <1312361359-15445-1-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 00/16] SCSI sense and target request overhaul List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On 08/03/2011 03:49 AM, Paolo Bonzini wrote: > This is a pretty important step in the modernization and improvement > of the SCSI backends, and a prerequisite for pretty much everything > that is on the table: migration, addressing, improved CD-ROM support, > hotplug. Applied all. Thanks. It fuzzed a bit, it seems pretty trivial to me but wouldn't hurt to double check. I tested SCSI quite a bit afterwards too. Regards, Anthony Liguori > > The series touches two main parts: > > 1) sense data. Autosense is made a first-class citizen of the > subsystem. Sense data is communicated to the target primarily > via autosense, and it is then the target that uses this information > to reply to REQUEST SENSE commands. In addition, each LUN or > target can be in a unit attention condition, which will be > communicated via either autosense or REQUEST SENSE, or cleared > automatically. > > 2) target requests. The common example of this is REPORT LUNS > and commands sent to invalid LUNs. Handling of these commands > previously had to be done for every SCSIDevice. This series splits > request-related SCSIDevice callbacks out into a new SCSIReqOps > structure, thus allowing the target (SCSIBus) to hijack those requests > and reply to them without involving the SCSIDevice at all. The > system is quite flexible, and is also used for invalid commands, > REQUEST SENSE and commands sent while a unit attention > condition is pending. > > Finally, other parts of the SCSIDevice code are moved to common > code including general parsing of requests. > > The two parts are slightly intertwined. Sense data is handled by patches > 2/3/4/12/13/14/15, and target requests are handled by patches 5 to 11. > (patches 1 and 16 are somewhat unrelated). The reason for this is that > the current device-specific handling of sense data conflicts heavily > with the goal of handling some commands in a device-independent way. > So, the series starts by moving sense handling to generic code, and > comes back to generic handling of REQUEST SENSE and unit attention after > implementing a few others device-independent requests. > > It conflicts somewhat with Markus's tray series, but not in a > fatal way; the conflicts are trivial. > > Paolo Bonzini (16): > scsi-disk: no need to call scsi_req_data on a short read > vscsi: always use get_sense > scsi: pass status when completing > scsi: move sense handling to generic code > scsi: introduce SCSIReqOps > scsi: move request-related callbacks from SCSIDeviceInfo to SCSIReqOps > scsi: pass cdb already to scsi_req_new > scsi: introduce SCSICommand > scsi: push lun field to SCSIDevice > scsi: move request parsing to common code > scsi: move handling of REPORT LUNS and invalid LUNs to common code > scsi: move handling of REQUEST SENSE to common code > scsi: add a bunch more common sense codes > scsi: add support for unit attention conditions > scsi: report unit attention on reset > scsi: add special traces for common commands > > hw/esp.c | 4 +- > hw/lsi53c895a.c | 4 +- > hw/scsi-bus.c | 578 +++++++++++++++++++++++++++++++++++++++++++++-------- > hw/scsi-defs.h | 4 + > hw/scsi-disk.c | 164 +++++----------- > hw/scsi-generic.c | 156 ++++----------- > hw/scsi.h | 72 +++++-- > hw/spapr_vscsi.c | 95 ++------- > hw/usb-msd.c | 4 +- > trace-events | 5 + > 10 files changed, 668 insertions(+), 418 deletions(-) >