From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRaEs-0007op-I1 for qemu-devel@nongnu.org; Tue, 18 Aug 2015 02:19:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZRaEn-00025g-Dh for qemu-devel@nongnu.org; Tue, 18 Aug 2015 02:19:14 -0400 Received: from mx2.suse.de ([195.135.220.15]:45601) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRaEn-00025c-7L for qemu-devel@nongnu.org; Tue, 18 Aug 2015 02:19:09 -0400 Message-ID: <55D2CE5C.6040801@suse.de> Date: Tue, 18 Aug 2015 08:19:08 +0200 From: Hannes Reinecke MIME-Version: 1.0 References: <1439854945-5597-1-git-send-email-abezzubikov@ispras.ru> <1439854945-5597-11-git-send-email-abezzubikov@ispras.ru> In-Reply-To: <1439854945-5597-11-git-send-email-abezzubikov@ispras.ru> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH RFC 10/11] ide: corrected ATAPI checks to be ignored by ATAPI-SCSI bridge 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/ide/atapi.c | 18 ++++++++++-------- > 1 file changed, 10 insertions(+), 8 deletions(-) >=20 > diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c > index 6e73910..896f595 100644 > --- a/hw/ide/atapi.c > +++ b/hw/ide/atapi.c > @@ -1230,7 +1230,8 @@ void ide_atapi_cmd(IDEState *s) > * states rely on this behavior. > */ > if (!(atapi_cmd_table[s->io_buffer[0]].flags & ALLOW_UA) && > - !s->tray_open && blk_is_inserted(s->blk) && s->cdrom_changed) = { > + (s->drive_kind !=3D IDE_BRIDGE && !s->tray_open && > + blk_is_inserted(s->blk) && s->cdrom_changed)) { > =20 > if (s->cdrom_changed =3D=3D 1) { > ide_atapi_cmd_error(s, NOT_READY, ASC_MEDIUM_NOT_PRESENT); > @@ -1245,18 +1246,13 @@ void ide_atapi_cmd(IDEState *s) > =20 > /* Report a Not Ready condition if appropriate for the command */ > if ((atapi_cmd_table[s->io_buffer[0]].flags & CHECK_READY) && > - (!media_present(s) || !blk_is_inserted(s->blk))) > + (s->drive_kind !=3D IDE_BRIDGE && > + (!media_present(s) || !blk_is_inserted(s->blk)))) > { > ide_atapi_cmd_error(s, NOT_READY, ASC_MEDIUM_NOT_PRESENT); > return; > } > =20 > - /* Execute the command */ > - if (atapi_cmd_table[s->io_buffer[0]].handler) { > - atapi_cmd_table[s->io_buffer[0]].handler(s, buf); > - return; > - } > - > if (s->drive_kind =3D=3D IDE_BRIDGE) { > IDEDevice *dev =3D s->bus->master; > SCSIDevice *scsi_dev =3D scsi_device_find(&dev->scsi_bus, 0, 0= , 0); > @@ -1273,5 +1269,11 @@ void ide_atapi_cmd(IDEState *s) > return; > } > =20 > + /* Execute the command */ > + if (atapi_cmd_table[s->io_buffer[0]].handler) { > + atapi_cmd_table[s->io_buffer[0]].handler(s, buf); > + return; > + } > + > ide_atapi_cmd_error(s, ILLEGAL_REQUEST, ASC_ILLEGAL_OPCODE); > } >=20 Please merge it with patch 3. 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)