From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hannes Reinecke Subject: [PATCH 0/3] [v4] Megasas HBA emulation Date: Fri, 1 Jul 2011 09:42:49 +0200 Message-ID: <1309506172-17762-1-git-send-email-hare@suse.de> Cc: Paolo Bonzini , Stefan Haynoczi , kvm@vger.kernel.org, Alexander Graf , Hannes Reinecke To: qemu-devel@nongnu.org Return-path: Received: from cantor2.suse.de ([195.135.220.15]:40819 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755284Ab1GAHn2 (ORCPT ); Fri, 1 Jul 2011 03:43:28 -0400 Sender: kvm-owner@vger.kernel.org List-ID: Hi all, thanks to Paolo and Stefan most of the SCSI patches are now in, so I've made the next attempt of submitting my Megaraid SAS HBA emulation. To do so, I've done two additional patches, both should be valid cleanups. - Replace 'tag' by 'hba_private' The SCSIRequest structure has a 'tag', which is being used by the drivers to match the SCSIRequest to the internal request structure. The only driver actually to benefit from this is the lsi53c895a driver, everyone else either leaves it blank or uses some internal numberting here. So this patch converts the 'tag' to a 'hba_private' pointer, which allows the driver to store a pointer to the internal structure directly within the SCSIRequest. This saves the lookup and an additional field in the driver internal request structure. - Add an 'offset' parameter to iov_to_buf() iov_from_buf() has it, but iov_to_buf() has it not. But we'll be needing it if the iovec is larger than the buffer. So there. And, of course, the megasas driver itself. Which has been modified to work with the new interface; otherwise there have been no changes to the previous submission. Hannes Reinecke (3): iov: Add 'offset' parameter to iov_to_buf() scsi: replace 'tag' with 'hba_private' pointer megasas: LSI Megaraid SAS emulation Makefile.objs | 1 + default-configs/pci.mak | 1 + hw/esp.c | 2 +- hw/lsi53c895a.c | 17 +- hw/megasas.c | 1923 +++++++++++++++++++++++++++++++++++++++++++++++ hw/mfi.h | 1197 +++++++++++++++++++++++++++++ hw/pci_ids.h | 3 +- hw/scsi-bus.c | 22 +- hw/scsi-disk.c | 5 +- hw/scsi-generic.c | 4 +- hw/scsi.h | 8 +- hw/spapr_vscsi.c | 41 +- hw/usb-msd.c | 10 +- hw/virtio-net.c | 2 +- hw/virtio-serial-bus.c | 2 +- iov.c | 23 +- iov.h | 2 +- trace-events | 14 +- 18 files changed, 3193 insertions(+), 84 deletions(-) create mode 100644 hw/megasas.c create mode 100644 hw/mfi.h