From patchwork Sat Jul 4 06:06:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Snow X-Patchwork-Id: 491183 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 71E9414090B for ; Sat, 4 Jul 2015 16:10:07 +1000 (AEST) Received: from localhost ([::1]:43275 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBGeL-000367-0P for incoming@patchwork.ozlabs.org; Sat, 04 Jul 2015 02:10:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBGbj-0006DN-K9 for qemu-devel@nongnu.org; Sat, 04 Jul 2015 02:07:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZBGbf-0003QA-Gl for qemu-devel@nongnu.org; Sat, 04 Jul 2015 02:07:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50381) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBGbf-0003Q4-Bh for qemu-devel@nongnu.org; Sat, 04 Jul 2015 02:07:19 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 0C7763187D8; Sat, 4 Jul 2015 06:07:19 +0000 (UTC) Received: from scv.usersys.redhat.com (vpn-62-174.rdu2.redhat.com [10.10.62.174]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t6467FZO009272; Sat, 4 Jul 2015 02:07:18 -0400 From: John Snow To: qemu-devel@nongnu.org Date: Sat, 4 Jul 2015 02:06:43 -0400 Message-Id: <1435990034-8945-5-git-send-email-jsnow@redhat.com> In-Reply-To: <1435990034-8945-1-git-send-email-jsnow@redhat.com> References: <1435990034-8945-1-git-send-email-jsnow@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: peter.maydell@linaro.org, jsnow@redhat.com Subject: [Qemu-devel] [PULL 04/35] qtest/ahci: add port_reset test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Message-id: 1434470575-21625-5-git-send-email-jsnow@redhat.com --- tests/ahci-test.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/ahci-test.c b/tests/ahci-test.c index a7b4df2..0a0ef2a 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 */ @@ -1623,6 +1646,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();