From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8sbT-0002po-Uy for qemu-devel@nongnu.org; Wed, 07 Jan 2015 10:33:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y8sbO-0000Kl-SI for qemu-devel@nongnu.org; Wed, 07 Jan 2015 10:32:59 -0500 Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:51175) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8sbO-0000KX-IM for qemu-devel@nongnu.org; Wed, 07 Jan 2015 10:32:54 -0500 Received: by mail-wi0-f175.google.com with SMTP id l15so7741967wiw.2 for ; Wed, 07 Jan 2015 07:32:54 -0800 (PST) Date: Wed, 7 Jan 2015 15:32:51 +0000 From: Stefan Hajnoczi Message-ID: <20150107153251.GG22440@stefanha-thinkpad.redhat.com> References: <1418235427-1081-1-git-send-email-jsnow@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ulDeV4rPMk/y39in" Content-Disposition: inline In-Reply-To: <1418235427-1081-1-git-send-email-jsnow@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2] ide: Implement VPD response for ATAPI List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, armbru@redhat.com --ulDeV4rPMk/y39in Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 10, 2014 at 01:17:07PM -0500, John Snow wrote: > SCSI devices have multiple kinds of queries they need to respond > to, as defined in the "cmd inquiry" section in MMC-6 and SPC-3. >=20 > Relevent sections: > MMC-6 revision 2g: > Non-VPD response data and pointer to SPC-3; > Section 6.8 "Inquiry Command" > SPC-3 revision 23: > Inquiry command and error handling: > Section 6.4 "INQUIRY command" > VPD data pages format: > Section 7.6 "Vital product data parameters" >=20 > We implement these Vital Product Data queries for SCSI, but not for > ATAPI through IDE. The result is that if you are looking for the WWN > identifier via tools such as sg3_utils, you will be unable to query > our CD/DVD rom device to obtain it. >=20 > This patch adds the minimum number of mandatory responses as defined > by SPC-3, which include the "supported pages" response (page 0x00) > and the "Device Identification" response (page 0x83). It also correctly > responds when it receives a request for an illegal page to improve > error output from related tools. >=20 > The Device ID page contains an arbitrary list of identification > strings of various formats; the ID strings included in this patch > were chosen to mimic those provided by the libata driver when > emulating this SCSI query (model, serial, and wwn when present.) >=20 > Example: >=20 > # libata emulated response > [root@localhost ~]# sg_inq --id /dev/sda > VPD INQUIRY: Device Identification page > Designation descriptor number 1, descriptor length: 24 > designator_type: vendor specific [0x0], code_set: ASCII > associated with the addressed logical unit > vendor specific: QM00001 > Designation descriptor number 2, descriptor length: 72 > designator_type: T10 vendor identification, code_set: ASCII > associated with the addressed logical unit > vendor id: ATA > vendor specific: QEMU HARDDISK QM00001 >=20 > # QEMU generated ATAPI response, with WWN > [root@localhost ~]# sg_inq --id /dev/sr0 > VPD INQUIRY: Device Identification page > Designation descriptor number 1, descriptor length: 24 > designator_type: vendor specific [0x0], code_set: ASCII > associated with the addressed logical unit > vendor specific: QM00005 > Designation descriptor number 2, descriptor length: 72 > designator_type: T10 vendor identification, code_set: ASCII > associated with the addressed logical unit > vendor id: ATA > vendor specific: QEMU DVD-ROM QM00005 > Designation descriptor number 3, descriptor length: 12 > designator_type: NAA, code_set: Binary > associated with the addressed logical unit > NAA 5, IEEE Company_id: 0xc50 > Vendor Specific Identifier: 0x15ea71bb > [0x5000c50015ea71bb] >=20 > See also: hw/scsi/scsi-disk.c, scsi_disk_emulate_inquiry() >=20 > Signed-off-by: John Snow > --- >=20 > v2: > - Fixed failure to return after error > - Factor out some redundancy > - Make sure we always fill in the length for early return cases >=20 > hw/ide/atapi.c | 111 ++++++++++++++++++++++++++++++++++++++++++++++++= ------ > hw/ide/internal.h | 1 + > 2 files changed, 100 insertions(+), 12 deletions(-) Thanks, applied to my block tree: https://github.com/stefanha/qemu/commits/block Stefan --ulDeV4rPMk/y39in Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUrVGjAAoJEJykq7OBq3PIUPEIAJZDQKvEwNJ40sekWcaQNZz0 PjydGrLmRzFE51KvsarZRVATcuBmIORHpr8NdePdpyX+ygLMPgTNVEMgJkegeA6+ YxRYDUWdQxhvEATctxP3uCeBpz4CGJ0nKZ5vHwIYBb7udg7ZwCPCkNmgIJ5/LZDX gdM99fExiS6xb+NPSjzZe18YQqMWKArsdfTeP8upa/SeP3ZaWedBbqngKqZPu3CK d7hKt0Dv/fnGq2QfCIPhk6X0sU/A1vZ/r/FE5HkMbmCqwRTINWZ50bBrantF7QeT ERoUyKKXJ8O5/Mu+p8MI7AOZMK8kctUd+g3Xgxg8f1eNEUZyL/Dg8B3bJ9kflus= =Y7Mk -----END PGP SIGNATURE----- --ulDeV4rPMk/y39in--