[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 18/19] qtest/ahci: Assert sector size in identify
From: |
John Snow |
Subject: |
[Qemu-devel] [PATCH v3 18/19] qtest/ahci: Assert sector size in identify test |
Date: |
Thu, 5 Feb 2015 12:41:29 -0500 |
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 <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
---
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
- [Qemu-devel] [PATCH v3 06/19] libqos/ahci: Add ahci_port_check_interrupts helper, (continued)
- [Qemu-devel] [PATCH v3 06/19] libqos/ahci: Add ahci_port_check_interrupts helper, John Snow, 2015/02/05
- [Qemu-devel] [PATCH v3 05/19] libqos/ahci: Add ahci_port_check_error helper, John Snow, 2015/02/05
- [Qemu-devel] [PATCH v3 07/19] libqos/ahci: Add port_check_nonbusy helper, John Snow, 2015/02/05
- [Qemu-devel] [PATCH v3 14/19] libqos/ahci: add ahci command size setters, John Snow, 2015/02/05
- [Qemu-devel] [PATCH v3 13/19] libqos/ahci: add ahci command verify, John Snow, 2015/02/05
- [Qemu-devel] [PATCH v3 08/19] libqos/ahci: Add cmd response sanity check helpers, John Snow, 2015/02/05
- [Qemu-devel] [PATCH v3 17/19] libqos/ahci: Add ahci_clean_mem, John Snow, 2015/02/05
- [Qemu-devel] [PATCH v3 16/19] libqos/ahci: add ahci_io, John Snow, 2015/02/05
- [Qemu-devel] [PATCH v3 09/19] qtest/ahci: Demagic ahci tests., John Snow, 2015/02/05
- [Qemu-devel] [PATCH v3 11/19] libqos/ahci: Add ide cmd properties, John Snow, 2015/02/05
- [Qemu-devel] [PATCH v3 18/19] qtest/ahci: Assert sector size in identify test,
John Snow <=
- [Qemu-devel] [PATCH v3 12/19] libqos/ahci: add ahci command functions, John Snow, 2015/02/05
- [Qemu-devel] [PATCH v3 10/19] qtest/ahci: add ahci_write_fis, John Snow, 2015/02/05
- [Qemu-devel] [PATCH v3 15/19] libqos/ahci: Add ahci_guest_io, John Snow, 2015/02/05
- [Qemu-devel] [PATCH v3 19/19] qtest/ahci: Adding simple dma read-write test, John Snow, 2015/02/05
- Re: [Qemu-devel] [PATCH v3 00/19] qtest/ahci: add dma test, Stefan Hajnoczi, 2015/02/12