From ea41deb6022c1468de094dac12610de74220e4b0 Mon Sep 17 00:00:00 2001 From: John Snow Date: Thu, 5 Feb 2015 12:41:24 -0500 Subject: libqos/ahci: add ahci command verify Helps to verify that a command completed successfully. Signed-off-by: John Snow Reviewed-by: Paolo Bonzini Message-id: 1423158090-25580-14-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi --- tests/libqos/ahci.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/libqos/ahci.c') 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; -- cgit v1.2.3