From: John Snow <jsnow@redhat.com>
To: Hannes Reinecke <hare@suse.de>,
Alexander Bezzubikov <zuban32s@gmail.com>,
qemu-devel@nongnu.org
Cc: abezzubikov@ispras.ru
Subject: Re: [Qemu-devel] [PATCH RFC 08/11] scsi: SCSIDiskReq declaration moved to header
Date: Mon, 24 Aug 2015 20:31:36 -0400 [thread overview]
Message-ID: <55DBB768.2060203@redhat.com> (raw)
In-Reply-To: <55D2CE03.7050602@suse.de>
On 08/18/2015 02:17 AM, Hannes Reinecke wrote:
> On 08/18/2015 01:42 AM, Alexander Bezzubikov wrote:
>> Signed-off-by: Alexander Bezzubikov <abezzubikov@ispras.ru>
>> ---
>> hw/scsi/scsi-disk.c | 12 ------------
>> include/hw/scsi/scsi.h | 13 +++++++++++++
>> 2 files changed, 13 insertions(+), 12 deletions(-)
>>
>> diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
>> index f67d816..9d5f0a4 100644
>> --- a/hw/scsi/scsi-disk.c
>> +++ b/hw/scsi/scsi-disk.c
>> @@ -53,18 +53,6 @@ do { printf("scsi-disk: " fmt , ## __VA_ARGS__); } while (0)
>>
>> typedef struct SCSIDiskState SCSIDiskState;
>>
>> -typedef struct SCSIDiskReq {
>> - SCSIRequest req;
>> - /* Both sector and sector_count are in terms of qemu 512 byte blocks. */
>> - uint64_t sector;
>> - uint32_t sector_count;
>> - uint32_t buflen;
>> - bool started;
>> - struct iovec iov;
>> - QEMUIOVector qiov;
>> - BlockAcctCookie acct;
>> -} SCSIDiskReq;
>> -
>> #define SCSI_DISK_F_REMOVABLE 0
>> #define SCSI_DISK_F_DPOFUA 1
>> #define SCSI_DISK_F_NO_REMOVABLE_DEVOPS 2
>> diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h
>> index 881ed23..de0546e 100644
>> --- a/include/hw/scsi/scsi.h
>> +++ b/include/hw/scsi/scsi.h
>> @@ -6,6 +6,7 @@
>> #include "hw/block/block.h"
>> #include "sysemu/sysemu.h"
>> #include "qemu/notify.h"
>> +#include "block/accounting.h"
>>
>> #define MAX_SCSI_DEVS 255
>>
>> @@ -120,6 +121,18 @@ extern const VMStateDescription vmstate_scsi_device;
>> .offset = vmstate_offset_value(_state, _field, SCSIDevice), \
>> }
>>
>> +typedef struct SCSIDiskReq {
>> + SCSIRequest req;
>> + /* Both sector and sector_count are in terms of qemu 512 byte blocks. */
>> + uint64_t sector;
>> + uint32_t sector_count;
>> + uint32_t buflen;
>> + bool started;
>> + struct iovec iov;
>> + QEMUIOVector qiov;
>> + BlockAcctCookie acct;
>> +} SCSIDiskReq;
>> +
>> /* cdrom.c */
>> int cdrom_read_toc(int nb_sectors, uint8_t *buf, int msf, int start_track);
>> int cdrom_read_toc_raw(int nb_sectors, uint8_t *buf, int msf, int session_num);
>>
> I'm not sure this is a good idea; the abstraction model seems to be that
> scsi-disk.h contains all declarations for the SCSI disk model, and as
> such the struct should remain there.
>
> Probably it might be better to create a 'scsi-disk.h' include file, to
> contain all necessary things.
>
> But actually I'm not sure.
> John? What's your opinion here?
>
> Cheers,
>
> Hannes
>
I know I'm working from outdated copies here, but my guess would be to
attempt to limit exposure of this struct. Putting it in scsi.h probably
exposes it to more files than we anticipate.
I'll see what happens in v2 through v4 :)
--js
next prev parent reply other threads:[~2015-08-25 0:31 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-17 23:42 [Qemu-devel] [PATCH RFC 00/11] QEMU ATAPI-SCSI bridge GSoC project Alexander Bezzubikov
2015-08-17 23:42 ` [Qemu-devel] [PATCH RFC 01/11] ide: ATAPI-SCSI bridge TypeInfo and init function created Alexander Bezzubikov
2015-08-18 6:07 ` Hannes Reinecke
2015-08-17 23:42 ` [Qemu-devel] [PATCH RFC 02/11] ide: necessary fields for ATAPI-SCSI bridge added Alexander Bezzubikov
2015-08-18 6:08 ` Hannes Reinecke
2015-08-18 23:50 ` Thomas Huth
2015-08-19 5:56 ` Hannes Reinecke
2015-08-17 23:42 ` [Qemu-devel] [PATCH RFC 03/11] ide: necessary checks corrected to treat ATAPI-SCSI bridge as CDROM Alexander Bezzubikov
2015-08-18 6:09 ` Hannes Reinecke
2015-08-17 23:42 ` [Qemu-devel] [PATCH RFC 04/11] scsi: Added function to enable ATAPI-SCSI bridge send SCSI requests Alexander Bezzubikov
2015-08-18 6:10 ` Hannes Reinecke
2015-08-17 23:42 ` [Qemu-devel] [PATCH RFC 05/11] ide: bridge 'transfer' and 'complete' functions added Alexander Bezzubikov
2015-08-18 6:11 ` Hannes Reinecke
2015-08-17 23:42 ` [Qemu-devel] [PATCH RFC 06/11] ide: ATAPI-SCSI bridge can now forward requests to SCSI Alexander Bezzubikov
2015-08-18 6:12 ` Hannes Reinecke
2015-08-17 23:42 ` [Qemu-devel] [PATCH RFC 07/11] ide: Makefile corrected due to bridge creation Alexander Bezzubikov
2015-08-18 6:13 ` Hannes Reinecke
2015-08-17 23:42 ` [Qemu-devel] [PATCH RFC 08/11] scsi: SCSIDiskReq declaration moved to header Alexander Bezzubikov
2015-08-18 6:17 ` Hannes Reinecke
2015-08-25 0:31 ` John Snow [this message]
2015-08-17 23:42 ` [Qemu-devel] [PATCH RFC 09/11] ide: ide_bridge_do_transfer is treated as PIO transfer Alexander Bezzubikov
2015-08-18 6:18 ` Hannes Reinecke
2015-08-17 23:42 ` [Qemu-devel] [PATCH RFC 10/11] ide: corrected ATAPI checks to be ignored by ATAPI-SCSI bridge Alexander Bezzubikov
2015-08-18 6:19 ` Hannes Reinecke
2015-08-17 23:42 ` [Qemu-devel] [PATCH RFC 11/11] ide: bridge functions assigned to SCSIBusInfo, bridge is OK now Alexander Bezzubikov
2015-08-18 6:19 ` Hannes Reinecke
2015-08-18 6:21 ` [Qemu-devel] [PATCH RFC 00/11] QEMU ATAPI-SCSI bridge GSoC project Hannes Reinecke
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=55DBB768.2060203@redhat.com \
--to=jsnow@redhat.com \
--cc=abezzubikov@ispras.ru \
--cc=hare@suse.de \
--cc=qemu-devel@nongnu.org \
--cc=zuban32s@gmail.com \
/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).