aboutsummaryrefslogtreecommitdiff
path: root/tests/libqos/ahci.c
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2015-02-05 12:41:24 -0500
committerStefan Hajnoczi <stefanha@redhat.com>2015-02-16 15:07:17 +0000
commitea41deb6022c1468de094dac12610de74220e4b0 (patch)
tree1993897fee79be43da7c0df2364e0f076559ac50 /tests/libqos/ahci.c
parent64a5a272e31c99cfb348f908d71c98d2eb83ba28 (diff)
libqos/ahci: add ahci command verify
Helps to verify that a command completed successfully. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1423158090-25580-14-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'tests/libqos/ahci.c')
-rw-r--r--tests/libqos/ahci.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c
index 21f86c0799..09e7159d25 100644
--- a/tests/libqos/ahci.c
+++ b/tests/libqos/ahci.c
@@ -737,6 +737,21 @@ void ahci_command_issue(AHCIQState *ahci, AHCICommand *cmd)
ahci_command_wait(ahci, cmd);
}
+void ahci_command_verify(AHCIQState *ahci, AHCICommand *cmd)
+{
+ uint8_t slot = cmd->slot;
+ uint8_t port = cmd->port;
+
+ ahci_port_check_error(ahci, port);
+ ahci_port_check_interrupts(ahci, port, cmd->interrupts);
+ ahci_port_check_nonbusy(ahci, port, slot);
+ ahci_port_check_cmd_sanity(ahci, port, slot, cmd->xbytes);
+ ahci_port_check_d2h_sanity(ahci, port, slot);
+ if (cmd->props->pio) {
+ ahci_port_check_pio_sanity(ahci, port, slot, cmd->xbytes);
+ }
+}
+
uint8_t ahci_command_slot(AHCICommand *cmd)
{
return cmd->slot;