kvm: qemu: GET_CONFIGURATION fixes to allow OpenSolaris CD-ROM access
This patch complements "Partial IDE DVD emulation" (revision 1.66 for ide.c
in qemu's cvs) that is generating the following timeouts for OpenSolaris
guests when trying to access the ATAPI cdrom (ex: during installation):
WARNING: /pci@0,0/pci-ide@1,1/ide@1 (ata1);
timeout: abort request, target=0 lun=0
WARNING: /pci@0,0/pci-ide@1,1/ide@1 (ata1):
timeout: abort device, target=0 lun=0
WARNING: /pci@0,0/pci-ide@1,1/ide@1 (ata1):
timeout: reset target, target=0 lun=0
WARNING: /pci@0,0/pci-ide@1,1/ide@1 (ata1):
timeout: reset bus, target=0 lun=0
The changes required to the "GET CONFIGURATION" implementation are :
* recognize and honor "Allocation Length" input parameter
* only set "current profile" for the response if a profile is current
(either CD or DVD loaded)
* calculate "data length" including all headers
* refactor code and add comments to help document references to all
implemented standards (ATAPI-4, SPC-3 and MMC-6)
Signed-off-by: Carlo Marcelo Arenas Belon <carenas@sajinet.com.pe>
Signed-off-by: Avi Kivity <avi@qumranet.com>