From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SYf6y-0003AO-St for qemu-devel@nongnu.org; Sun, 27 May 2012 11:10:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SYf6x-0004FH-59 for qemu-devel@nongnu.org; Sun, 27 May 2012 11:10:28 -0400 Received: from cantor2.suse.de ([195.135.220.15]:53338 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SYf6w-0004F9-Un for qemu-devel@nongnu.org; Sun, 27 May 2012 11:10:27 -0400 Message-ID: <4FC243DB.4010206@suse.de> Date: Sun, 27 May 2012 17:10:19 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1338129690-42835-1-git-send-email-andreas.faerber@web.de> In-Reply-To: <1338129690-42835-1-git-send-email-andreas.faerber@web.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH for-1.1] virtio-blk: Fix unused variables in virtio_blk_handle_scsi() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Paolo Bonzini , Anthony Liguori , qemu-devel@nongnu.org Am 27.05.2012 16:41, schrieb Andreas F=C3=A4rber: > Commit f34e73cd69bdbdb9b1d56b288c5e14d6fff58165 (virtio-blk: report > non-zero status when failing SG_IO requests) exposed the function > to non-Linux guests. Move all Linux-only variable declarations into "hosts", obviously. Please fix when applying. Thanks, Andreas > an #ifdef in the variable declaration block. >=20 > Signed-off-by: Andreas F=C3=A4rber > Cc: Paolo Bonzini > --- > hw/virtio-blk.c | 6 ++++-- > 1 files changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c > index f9e1896..a1b64cb 100644 > --- a/hw/virtio-blk.c > +++ b/hw/virtio-blk.c > @@ -147,9 +147,12 @@ static VirtIOBlockReq *virtio_blk_get_request(Virt= IOBlock *s) > =20 > static void virtio_blk_handle_scsi(VirtIOBlockReq *req) > { > - int ret; > int status =3D VIRTIO_BLK_S_OK; > +#ifdef __linux__ > + struct sg_io_hdr hdr; > + int ret; > int i; > +#endif > =20 > /* > * We require at least one output segment each for the virtio_blk_= outhdr > @@ -184,7 +187,6 @@ static void virtio_blk_handle_scsi(VirtIOBlockReq *= req) > } > =20 > #ifdef __linux__ > - struct sg_io_hdr hdr; > memset(&hdr, 0, sizeof(struct sg_io_hdr)); > hdr.interface_id =3D 'S'; > hdr.cmd_len =3D req->elem.out_sg[1].iov_len; --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg