OSDN Git Service

ahci: Fix byte count regression for ATAPI/PIO
authorJohn Snow <jsnow@redhat.com>
Tue, 11 Nov 2014 00:41:40 +0000 (19:41 -0500)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 14 Nov 2014 09:20:34 +0000 (09:20 +0000)
commita395f3fa2f26c94dac03b37e3dfb1074bfe2ddea
treeb211a658f1a1f2da1db3d61fd24fba87a7942cf8
parentc52e67924fbdadfa00668248f5c075542943c54c
ahci: Fix byte count regression for ATAPI/PIO

This patch fixes a regression caused by commit
659142ecf71a0da240ab0ff7cf929ee25c32b9bc.
The problem occurs when we wish to return early
from the ahci_start_transfer function, but are now
updating the transferred byte count in the AHCI
command header via ahci_commit_buf.

This will cause problems in the Windows 8 installer.

Don't update the byte count in the command header
for the transmission of ATAPI packets: These commands
will distort the final byte count of the actual data
payload.

The call to ahci_commit_buf remains in the "out"
portion of the call in order to clean up the sglist.
The byte count is maintained by forcing size to be 0.

Signed-off-by: John Snow <jsnow@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/ide/ahci.c