From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50244) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHGWZ-0008Mr-TY for qemu-devel@nongnu.org; Fri, 30 Jan 2015 13:42:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YHGWY-0000IP-Rt for qemu-devel@nongnu.org; Fri, 30 Jan 2015 13:42:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41487) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHGWY-0000He-LN for qemu-devel@nongnu.org; Fri, 30 Jan 2015 13:42:34 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0UIgYc3016358 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 30 Jan 2015 13:42:34 -0500 From: John Snow Date: Fri, 30 Jan 2015 13:42:12 -0500 Message-Id: <1422643333-27926-19-git-send-email-jsnow@redhat.com> In-Reply-To: <1422643333-27926-1-git-send-email-jsnow@redhat.com> References: <1422643333-27926-1-git-send-email-jsnow@redhat.com> Subject: [Qemu-devel] [PATCH 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 --- tests/ahci-test.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/ahci-test.c b/tests/ahci-test.c index 9207e73..cae94b5 100644 --- a/tests/ahci-test.c +++ b/tests/ahci-test.c @@ -678,6 +678,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); @@ -725,6 +726,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