From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIlJK-0002A0-A5 for qemu-devel@nongnu.org; Tue, 03 Feb 2015 16:47:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YIlJC-0002iA-Od for qemu-devel@nongnu.org; Tue, 03 Feb 2015 16:47:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46160) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIlJC-0002i1-GD for qemu-devel@nongnu.org; Tue, 03 Feb 2015 16:46:58 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t13Lkvxm002858 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 3 Feb 2015 16:46:58 -0500 From: John Snow Date: Tue, 3 Feb 2015 16:46:38 -0500 Message-Id: <1422999999-25868-19-git-send-email-jsnow@redhat.com> In-Reply-To: <1422999999-25868-1-git-send-email-jsnow@redhat.com> References: <1422999999-25868-1-git-send-email-jsnow@redhat.com> Subject: [Qemu-devel] [PATCH v2 18/19] qtest/ahci: Assert sector size in identify test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: famz@redhat.com, mst@redhat.com, armbru@redhat.com, stefanha@redhat.com, pbonzini@redhat.com, John Snow A minor sanity check to assert that the sector size is 512. The current block layer code deeply assumes that the IDE sector size will be 512 bytes, so we carry forward that assumption here. This is useful for the DMA tests, which currently assume that a sector will always be 512 bytes. Signed-off-by: John Snow Reviewed-by: Paolo Bonzini --- tests/ahci-test.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/ahci-test.c b/tests/ahci-test.c index 3a0131a..f595b96 100644 --- a/tests/ahci-test.c +++ b/tests/ahci-test.c @@ -663,6 +663,7 @@ static void ahci_test_identify(AHCIQState *ahci) uint16_t buff[256]; unsigned px; int rc; + uint16_t sect_size; const size_t buffsize = 512; g_assert(ahci != NULL); @@ -710,6 +711,9 @@ static void ahci_test_identify(AHCIQState *ahci) string_bswap16(&buff[23], 8); rc = memcmp(&buff[23], "version ", 8); g_assert_cmphex(rc, ==, 0); + + sect_size = le16_to_cpu(*((uint16_t *)(&buff[5]))); + g_assert_cmphex(sect_size, ==, 0x200); } /******************************************************************************/ -- 1.9.3