From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQ3dH-0004Ct-8C for qemu-devel@nongnu.org; Mon, 23 Feb 2015 19:45:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQ3d2-00016r-JE for qemu-devel@nongnu.org; Mon, 23 Feb 2015 19:45:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52840) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQ3d2-00016a-B3 for qemu-devel@nongnu.org; Mon, 23 Feb 2015 19:45:36 -0500 From: John Snow Date: Mon, 23 Feb 2015 19:45:24 -0500 Message-Id: <1424738729-17082-2-git-send-email-jsnow@redhat.com> In-Reply-To: <1424738729-17082-1-git-send-email-jsnow@redhat.com> References: <1424738729-17082-1-git-send-email-jsnow@redhat.com> Subject: [Qemu-devel] [PATCH 1/6] qtest/ahci: Add simple flush test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, marc.mari.barcelo@gmail.com, stefanha@redhat.com, pbonzini@redhat.com, John Snow , afaerber@suse.de Signed-off-by: John Snow --- tests/ahci-test.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/ahci-test.c b/tests/ahci-test.c index f536b19..378cfe5 100644 --- a/tests/ahci-test.c +++ b/tests/ahci-test.c @@ -774,6 +774,29 @@ static void ahci_test_io_rw_simple(AHCIQState *ahci, unsigned bufsize, g_free(rx); } +static void ahci_test_nondata(AHCIQState *ahci, uint8_t ide_cmd) +{ + uint8_t px; + AHCICommand *cmd; + + /* Sanitize */ + px = ahci_port_select(ahci); + ahci_port_clear(ahci, px); + + /* Issue Command */ + cmd = ahci_command_create(ide_cmd); + ahci_command_commit(ahci, cmd, px); + ahci_command_issue(ahci, cmd); + ahci_command_verify(ahci, cmd); + ahci_command_free(cmd); +} + +static void ahci_test_flush(AHCIQState *ahci) +{ + ahci_test_nondata(ahci, CMD_FLUSH_CACHE); +} + + /******************************************************************************/ /* Test Interfaces */ /******************************************************************************/ @@ -911,6 +934,15 @@ static void test_dma_fragmented(void) g_free(tx); } +static void test_flush(void) +{ + AHCIQState *ahci; + + ahci = ahci_boot_and_enable(); + ahci_test_flush(ahci); + ahci_shutdown(ahci); +} + /******************************************************************************/ /* AHCI I/O Test Matrix Definitions */ @@ -1150,6 +1182,8 @@ int main(int argc, char **argv) qtest_add_func("/ahci/io/dma/lba28/fragmented", test_dma_fragmented); + qtest_add_func("/ahci/flush/simple", test_flush); + ret = g_test_run(); /* Cleanup */ -- 1.9.3