From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRaDR-0006o5-FU for qemu-devel@nongnu.org; Tue, 18 Aug 2015 02:17:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZRaDM-0001Rg-Ch for qemu-devel@nongnu.org; Tue, 18 Aug 2015 02:17:45 -0400 Received: from mx2.suse.de ([195.135.220.15]:45547) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRaDM-0001Qg-7S for qemu-devel@nongnu.org; Tue, 18 Aug 2015 02:17:40 -0400 Message-ID: <55D2CE03.7050602@suse.de> Date: Tue, 18 Aug 2015 08:17:39 +0200 From: Hannes Reinecke MIME-Version: 1.0 References: <1439854945-5597-1-git-send-email-abezzubikov@ispras.ru> <1439854945-5597-9-git-send-email-abezzubikov@ispras.ru> In-Reply-To: <1439854945-5597-9-git-send-email-abezzubikov@ispras.ru> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH RFC 08/11] scsi: SCSIDiskReq declaration moved to header List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Bezzubikov , qemu-devel@nongnu.org Cc: jsnow@redhat.com, abezzubikov@ispras.ru On 08/18/2015 01:42 AM, Alexander Bezzubikov wrote: > Signed-off-by: Alexander Bezzubikov > --- > hw/scsi/scsi-disk.c | 12 ------------ > include/hw/scsi/scsi.h | 13 +++++++++++++ > 2 files changed, 13 insertions(+), 12 deletions(-) >=20 > 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__); } w= hile (0) > =20 > typedef struct SCSIDiskState SCSIDiskState; > =20 > -typedef struct SCSIDiskReq { > - SCSIRequest req; > - /* Both sector and sector_count are in terms of qemu 512 byte bloc= ks. */ > - 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" > =20 > #define MAX_SCSI_DEVS 255 > =20 > @@ -120,6 +121,18 @@ extern const VMStateDescription vmstate_scsi_devic= e; > .offset =3D vmstate_offset_value(_state, _field, SCSIDevice), = \ > } > =20 > +typedef struct SCSIDiskReq { > + SCSIRequest req; > + /* Both sector and sector_count are in terms of qemu 512 byte bloc= ks. */ > + 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_tr= ack); > int cdrom_read_toc_raw(int nb_sectors, uint8_t *buf, int msf, int sess= ion_num); >=20 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 --=20 Dr. Hannes Reinecke zSeries & Storage hare@suse.de +49 911 74053 688 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg GF: J. Hawn, J. Guild, F. Imend=F6rffer, HRB 16746 (AG N=FCrnberg)