summaryrefslogtreecommitdiffstats
path: root/tests/libqos/ahci.c
diff options
context:
space:
mode:
authorJohn Snow2016-01-11 20:10:43 +0100
committerJohn Snow2016-01-11 20:10:43 +0100
commitb682d3a7cf249dc472e3fb76bf49afeaa3eba525 (patch)
tree05a05424e90c1c0dda0007309278cf1eeaf5cb79 /tests/libqos/ahci.c
parentlibqos: allow zero-size allocations (diff)
downloadqemu-b682d3a7cf249dc472e3fb76bf49afeaa3eba525.tar.gz
qemu-b682d3a7cf249dc472e3fb76bf49afeaa3eba525.tar.xz
qemu-b682d3a7cf249dc472e3fb76bf49afeaa3eba525.zip
libqos/ahci: allow nondata commands for ahci_io variants
These variants try to set a data offset, even if you don't specify one. In the cases where the offset is zero and it's a nondata command, just ignore the instruction. Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 1452282920-21550-7-git-send-email-jsnow@redhat.com
Diffstat (limited to 'tests/libqos/ahci.c')
-rw-r--r--tests/libqos/ahci.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c
index 6536408a7d..a9a745eef5 100644
--- a/tests/libqos/ahci.c
+++ b/tests/libqos/ahci.c
@@ -842,6 +842,9 @@ void ahci_command_set_offset(AHCICommand *cmd, uint64_t lba_sect)
if (cmd->props->atapi) {
ahci_atapi_command_set_offset(cmd, lba_sect);
return;
+ } else if (!cmd->props->data && !lba_sect) {
+ /* Not meaningful, ignore. */
+ return;
} else if (cmd->props->lba28) {
g_assert_cmphex(lba_sect, <=, 0xFFFFFFF);
} else if (cmd->props->lba48 || cmd->props->ncq) {