[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 37/65] qtest/ahci: Assert sector size in identify tes
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 37/65] qtest/ahci: Assert sector size in identify test |
Date: |
Fri, 13 Feb 2015 16:24:33 +0000 |
From: John Snow <address@hidden>
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>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <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);
}
/******************************************************************************/
--
2.1.0
- [Qemu-devel] [PULL 25/65] libqos/ahci: Add ahci_port_check_interrupts helper, (continued)
- [Qemu-devel] [PULL 25/65] libqos/ahci: Add ahci_port_check_interrupts helper, Stefan Hajnoczi, 2015/02/13
- [Qemu-devel] [PULL 28/65] qtest/ahci: Demagic ahci tests., Stefan Hajnoczi, 2015/02/13
- [Qemu-devel] [PULL 30/65] libqos/ahci: Add ide cmd properties, Stefan Hajnoczi, 2015/02/13
- [Qemu-devel] [PULL 29/65] qtest/ahci: add ahci_write_fis, Stefan Hajnoczi, 2015/02/13
- [Qemu-devel] [PULL 31/65] libqos/ahci: add ahci command functions, Stefan Hajnoczi, 2015/02/13
- [Qemu-devel] [PULL 34/65] libqos/ahci: Add ahci_guest_io, Stefan Hajnoczi, 2015/02/13
- [Qemu-devel] [PULL 27/65] libqos/ahci: Add cmd response sanity check helpers, Stefan Hajnoczi, 2015/02/13
- [Qemu-devel] [PULL 32/65] libqos/ahci: add ahci command verify, Stefan Hajnoczi, 2015/02/13
- [Qemu-devel] [PULL 33/65] libqos/ahci: add ahci command size setters, Stefan Hajnoczi, 2015/02/13
- [Qemu-devel] [PULL 36/65] libqos/ahci: Add ahci_clean_mem, Stefan Hajnoczi, 2015/02/13
- [Qemu-devel] [PULL 37/65] qtest/ahci: Assert sector size in identify test,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL 40/65] savevm: Improve error message for blocked migration, Stefan Hajnoczi, 2015/02/13
- [Qemu-devel] [PULL 38/65] qtest/ahci: Adding simple dma read-write test, Stefan Hajnoczi, 2015/02/13
- [Qemu-devel] [PULL 35/65] libqos/ahci: add ahci_io, Stefan Hajnoczi, 2015/02/13
- [Qemu-devel] [PULL 41/65] block: vmdk - fixed sizeof() error, Stefan Hajnoczi, 2015/02/13
- [Qemu-devel] [PULL 39/65] nbd: fix the co_queue multi-adding bug, Stefan Hajnoczi, 2015/02/13
- [Qemu-devel] [PULL 43/65] qemu-io: Account IO by aio_read and aio_write, Stefan Hajnoczi, 2015/02/13
- [Qemu-devel] [PULL 44/65] qtest: Add scripts/qtest.py, Stefan Hajnoczi, 2015/02/13
- [Qemu-devel] [PULL 45/65] qemu-iotests: Add VM method qtest() to iotests.py, Stefan Hajnoczi, 2015/02/13
- [Qemu-devel] [PULL 42/65] qtest: Fix deadloop by running main loop AIO context's timers, Stefan Hajnoczi, 2015/02/13
- [Qemu-devel] [PULL 46/65] qemu-iotests: Allow caller to disable underscore convertion for qmp, Stefan Hajnoczi, 2015/02/13