From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4cmN-0000OL-EV for qemu-devel@nongnu.org; Mon, 15 Jun 2015 18:22:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4cmM-0002qq-Kq for qemu-devel@nongnu.org; Mon, 15 Jun 2015 18:22:55 -0400 From: John Snow Date: Mon, 15 Jun 2015 18:22:45 -0400 Message-Id: <1434406965-30883-5-git-send-email-jsnow@redhat.com> In-Reply-To: <1434406965-30883-1-git-send-email-jsnow@redhat.com> References: <1434406965-30883-1-git-send-email-jsnow@redhat.com> Subject: [Qemu-devel] [PATCH 4/4] qtest/ahci: add port_reset test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: kwolf@redhat.com, John Snow , qemu-devel@nongnu.org, stefanha@redhat.com Test that we can survive a couple of cycles of running a basic identify test, some IO, and resetting the HBA. Ensures that we can bring the HBA back to compliant spec during the lifecycle of the VM. Signed-off-by: John Snow --- tests/ahci-test.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/ahci-test.c b/tests/ahci-test.c index 5148328..43da3d1 100644 --- a/tests/ahci-test.c +++ b/tests/ahci-test.c @@ -1372,6 +1372,29 @@ static void test_max(void) ahci_shutdown(ahci); } +static void test_reset(void) +{ + AHCIQState *ahci; + int i; + + ahci = ahci_boot(NULL); + ahci_test_pci_spec(ahci); + ahci_pci_enable(ahci); + + for (i = 0; i < 2; i++) { + ahci_test_hba_spec(ahci); + ahci_hba_enable(ahci); + ahci_test_identify(ahci); + ahci_test_io_rw_simple(ahci, 4096, 0, + CMD_READ_DMA_EXT, + CMD_WRITE_DMA_EXT); + ahci_set(ahci, AHCI_GHC, AHCI_GHC_HR); + ahci_clean_mem(ahci); + } + + ahci_shutdown(ahci); +} + /******************************************************************************/ /* AHCI I/O Test Matrix Definitions */ @@ -1628,6 +1651,7 @@ int main(int argc, char **argv) qtest_add_func("/ahci/migrate/dma/halted", test_migrate_halted_dma); qtest_add_func("/ahci/max", test_max); + qtest_add_func("/ahci/reset", test_reset); ret = g_test_run(); -- 2.1.0