From 6542ba6203e55ba5fa5a30171f9fa0690468aa33 Mon Sep 17 00:00:00 2001 Message-Id: <6542ba6203e55ba5fa5a30171f9fa0690468aa33.1419012926.git.jen@redhat.com> From: John Snow Date: Tue, 9 Sep 2014 17:08:53 -0500 Subject: [CHANGE 1/6] ide: Add wwn support to IDE-ATAPI drive To: rhvirt-patches@redhat.com, jen@redhat.com RH-Author: John Snow Message-id: <1410282533-9769-2-git-send-email-jsnow@redhat.com> Patchwork-id: 60925 O-Subject: [RHEL-6.7 qemu-kvm PATCH 1/1] ide: Add wwn support to IDE-ATAPI drive Bugzilla: 1130475 RH-Acked-by: Markus Armbruster RH-Acked-by: Stefan Hajnoczi RH-Acked-by: Paolo Bonzini RH-Acked-by: Fam Zheng Although it is possible to specify the wwn property for cdrom devices on the command line, the underlying driver fails to relay this information to the guest operating system via IDENTIFY. This is a simple patch to correct that. See ATA8-ACS, Table 22 parts 5, 6, and 9. Signed-off-by: John Snow Reviewed-by: Fam Zheng Signed-off-by: Stefan Hajnoczi (cherry picked from commit c5fe97e359bf03db9a005433092f25d27d57398f) Signed-off-by: John Snow --- hw/ide/core.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) Signed-off-by: Jeff E. Nelson --- hw/ide/core.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/hw/ide/core.c b/hw/ide/core.c index dd4b4c3..8db5710 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -200,9 +200,23 @@ static void ide_atapi_identify(IDEState *s) put_le16(p + 72, 30); /* in ns */ put_le16(p + 80, 0x1e); /* support up to ATA/ATAPI-4 */ + if (s->wwn) { + put_le16(p + 84, (1 << 8)); /* supports WWN for words 108-111 */ + put_le16(p + 87, (1 << 8)); /* WWN enabled */ + } + #ifdef USE_DMA_CDROM put_le16(p + 88, 0x3f | (1 << 13)); /* udma5 set and supported */ #endif + + if (s->wwn) { + /* LE 16-bit words 111-108 contain 64-bit World Wide Name */ + put_le16(p + 108, s->wwn >> 48); + put_le16(p + 109, s->wwn >> 32); + put_le16(p + 110, s->wwn >> 16); + put_le16(p + 111, s->wwn); + } + memcpy(s->identify_data, p, sizeof(s->identify_data)); s->identify_set = 1; } -- 2.1.0