qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com
Subject: [Qemu-devel] [PATCH v2 31/33] scsi: make reqops const
Date: Tue, 25 Oct 2011 12:40:39 +0200	[thread overview]
Message-ID: <1319539241-26436-32-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1319539241-26436-1-git-send-email-pbonzini@redhat.com>

Also delete a stale occurrence of SCSIReqOps inside SCSIDeviceInfo.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/scsi-bus.c     |   10 +++++-----
 hw/scsi-disk.c    |    2 +-
 hw/scsi-generic.c |    2 +-
 hw/scsi.h         |    7 +++----
 4 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
index bdd6e94..252e903 100644
--- a/hw/scsi-bus.c
+++ b/hw/scsi-bus.c
@@ -160,7 +160,7 @@ static int32_t scsi_invalid_command(SCSIRequest *req, uint8_t *buf)
     return 0;
 }
 
-struct SCSIReqOps reqops_invalid_opcode = {
+static const struct SCSIReqOps reqops_invalid_opcode = {
     .size         = sizeof(SCSIRequest),
     .send_command = scsi_invalid_command
 };
@@ -178,7 +178,7 @@ static int32_t scsi_unit_attention(SCSIRequest *req, uint8_t *buf)
     return 0;
 }
 
-struct SCSIReqOps reqops_unit_attention = {
+static const struct SCSIReqOps reqops_unit_attention = {
     .size         = sizeof(SCSIRequest),
     .send_command = scsi_unit_attention
 };
@@ -386,7 +386,7 @@ static uint8_t *scsi_target_get_buf(SCSIRequest *req)
     return r->buf;
 }
 
-struct SCSIReqOps reqops_target_command = {
+static const struct SCSIReqOps reqops_target_command = {
     .size         = sizeof(SCSITargetReq),
     .send_command = scsi_target_send_command,
     .read_data    = scsi_target_read_data,
@@ -394,8 +394,8 @@ struct SCSIReqOps reqops_target_command = {
 };
 
 
-SCSIRequest *scsi_req_alloc(SCSIReqOps *reqops, SCSIDevice *d, uint32_t tag,
-                            uint32_t lun, void *hba_private)
+SCSIRequest *scsi_req_alloc(const SCSIReqOps *reqops, SCSIDevice *d,
+                            uint32_t tag, uint32_t lun, void *hba_private)
 {
     SCSIRequest *req;
 
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index 4544f1c..b308f2a 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -1588,7 +1588,7 @@ static int scsi_disk_initfn(SCSIDevice *dev)
     }
 }
 
-static SCSIReqOps scsi_disk_reqops = {
+static const SCSIReqOps scsi_disk_reqops = {
     .size         = sizeof(SCSIDiskReq),
     .free_req     = scsi_free_request,
     .send_command = scsi_send_command,
diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c
index 9e293ee..7fe9b0d 100644
--- a/hw/scsi-generic.c
+++ b/hw/scsi-generic.c
@@ -449,7 +449,7 @@ static int scsi_generic_initfn(SCSIDevice *s)
     return 0;
 }
 
-static SCSIReqOps scsi_generic_req_ops = {
+static const SCSIReqOps scsi_generic_req_ops = {
     .size         = sizeof(SCSIGenericReq),
     .free_req     = scsi_free_request,
     .send_command = scsi_send_command,
diff --git a/hw/scsi.h b/hw/scsi.h
index d56e875..af558c3 100644
--- a/hw/scsi.h
+++ b/hw/scsi.h
@@ -41,7 +41,7 @@ struct SCSICommand {
 struct SCSIRequest {
     SCSIBus           *bus;
     SCSIDevice        *dev;
-    SCSIReqOps        *ops;
+    const SCSIReqOps  *ops;
     uint32_t          refcount;
     uint32_t          tag;
     uint32_t          lun;
@@ -96,7 +96,6 @@ struct SCSIDeviceInfo {
     SCSIRequest *(*alloc_req)(SCSIDevice *s, uint32_t tag, uint32_t lun,
                               void *hba_private);
     void (*unit_attention_reported)(SCSIDevice *s);
-    SCSIReqOps reqops;
 };
 
 struct SCSIBusInfo {
@@ -176,8 +175,8 @@ extern const struct SCSISense sense_code_DEVICE_INTERNAL_RESET;
 
 int scsi_sense_valid(SCSISense sense);
 
-SCSIRequest *scsi_req_alloc(SCSIReqOps *reqops, SCSIDevice *d, uint32_t tag,
-                            uint32_t lun, void *hba_private);
+SCSIRequest *scsi_req_alloc(const SCSIReqOps *reqops, SCSIDevice *d,
+                            uint32_t tag, uint32_t lun, void *hba_private);
 SCSIRequest *scsi_req_new(SCSIDevice *d, uint32_t tag, uint32_t lun,
                           uint8_t *buf, void *hba_private);
 int32_t scsi_req_enqueue(SCSIRequest *req);
-- 
1.7.6

  parent reply	other threads:[~2011-10-25 10:41 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-25 10:40 [Qemu-devel] [PULL v2 00/33] SCSI changes for 1.0, part 1 of 2 Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 01/33] scsi: pass correct sense code for ENOMEDIUM Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 02/33] atapi/scsi: unify definitions for MMC Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 03/33] atapi: move GESN definitions to scsi-defs.h Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 04/33] atapi: cleanup/fix mode sense results Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 05/33] scsi: notify the device when unit attention is reported Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 06/33] scsi-disk: report media changed via unit attention sense codes Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 07/33] scsi-disk: fix coding style issues (braces) Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 08/33] scsi-disk: add stubs for more MMC commands Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 09/33] scsi-disk: store valid mode pages in a table Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 10/33] atapi/scsi-disk: make mode page values coherent between the two Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 11/33] scsi-disk: support DVD profile in GET CONFIGURATION Paolo Bonzini
2012-01-25 16:34   ` Artyom Tarasenko
2012-01-25 17:03     ` Paolo Bonzini
2012-01-25 20:13       ` Artyom Tarasenko
2012-01-26  8:09         ` Paolo Bonzini
2012-01-26  8:23           ` ronnie sahlberg
2012-01-26  8:51             ` Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 12/33] scsi-disk: support READ DVD STRUCTURE Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 13/33] scsi-disk: report media changed via GET EVENT STATUS NOTIFICATION Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 14/33] scsi: move tcq/ndev to SCSIBusOps (now SCSIBusInfo) Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 15/33] qdev: switch children device list to QTAILQ Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 16/33] scsi: remove devs array from SCSIBus Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 17/33] scsi: implement REPORT LUNS for arbitrary LUNs Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 18/33] scsi: allow " Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 19/33] scsi: add channel to addressing Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 20/33] scsi-disk: fail READ CAPACITY if LBA != 0 but PMI == 0 Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 21/33] scsi-disk: fix retrying a flush Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 22/33] scsi-generic: drop SCSIGenericState Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 23/33] scsi-generic: remove scsi_req_fixup Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 24/33] scsi-generic: check ioctl statuses when SG_IO succeeds Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 25/33] scsi-generic: look at host status Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 26/33] scsi-generic: snoop READ CAPACITY commands to get block size Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 27/33] scsi-disk: do not duplicate BlockDriverState member Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 28/33] scsi-disk: remove cluster_size Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 29/33] scsi-disk: small clean up to INQUIRY Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 30/33] scsi: move max_lba to SCSIDevice Paolo Bonzini
2011-10-25 10:40 ` Paolo Bonzini [this message]
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 32/33] scsi: export scsi_generic_reqops Paolo Bonzini
2011-10-25 10:40 ` [Qemu-devel] [PATCH v2 33/33] scsi: pass cdb to alloc_req Paolo Bonzini
2011-10-27 11:45 ` [Qemu-devel] ping Re: [PULL v2 00/33] SCSI changes for 1.0, part 1 of 2 Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1319539241-26436-32-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).