[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/14] libqos/ahci: Fix sector set method
From: |
John Snow |
Subject: |
[Qemu-devel] [PULL 02/14] libqos/ahci: Fix sector set method |
Date: |
Mon, 11 May 2015 14:12:31 -0400 |
|| probably does not mean the same thing as |.
Additionally, allow users to submit a prd_size of 0
to indicate that they'd like to continue using the default.
Signed-off-by: John Snow <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Message-id: address@hidden
---
tests/libqos/ahci.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c
index 229409b..8c8fd89 100644
--- a/tests/libqos/ahci.c
+++ b/tests/libqos/ahci.c
@@ -769,7 +769,7 @@ void ahci_command_set_offset(AHCICommand *cmd, uint64_t
lba_sect)
fis->lba_lo[1] = (lba_sect >> 8) & 0xFF;
fis->lba_lo[2] = (lba_sect >> 16) & 0xFF;
if (cmd->props->lba28) {
- fis->device = (fis->device & 0xF0) || (lba_sect >> 24) & 0x0F;
+ fis->device = (fis->device & 0xF0) | ((lba_sect >> 24) & 0x0F);
}
fis->lba_hi[0] = (lba_sect >> 24) & 0xFF;
fis->lba_hi[1] = (lba_sect >> 32) & 0xFF;
@@ -787,7 +787,9 @@ void ahci_command_set_sizes(AHCICommand *cmd, uint64_t
xbytes,
/* Each PRD can describe up to 4MiB, and must not be odd. */
g_assert_cmphex(prd_size, <=, 4096 * 1024);
g_assert_cmphex(prd_size & 0x01, ==, 0x00);
- cmd->prd_size = prd_size;
+ if (prd_size) {
+ cmd->prd_size = prd_size;
+ }
cmd->xbytes = xbytes;
cmd->fis.count = (cmd->xbytes / AHCI_SECTOR_SIZE);
cmd->header.prdtl = size_to_prdtl(cmd->xbytes, cmd->prd_size);
--
2.1.0
- [Qemu-devel] [PULL 00/14] Ide patches, John Snow, 2015/05/11
- [Qemu-devel] [PULL 02/14] libqos/ahci: Fix sector set method,
John Snow <=
- [Qemu-devel] [PULL 01/14] libqos/ahci: Add halted command helpers, John Snow, 2015/05/11
- [Qemu-devel] [PULL 03/14] libqos: Add migration helpers, John Snow, 2015/05/11
- [Qemu-devel] [PULL 04/14] ich9/ahci: Enable Migration, John Snow, 2015/05/11
- [Qemu-devel] [PULL 07/14] qtest/ahci: add flush migrate test, John Snow, 2015/05/11
- [Qemu-devel] [PULL 05/14] qtest/ahci: Add migration test, John Snow, 2015/05/11
- [Qemu-devel] [PULL 08/14] qtest/ahci: add halted dma test, John Snow, 2015/05/11
- [Qemu-devel] [PULL 06/14] qtest/ahci: add migrate dma test, John Snow, 2015/05/11
- [Qemu-devel] [PULL 09/14] qtest/ahci: add migrate halted dma test, John Snow, 2015/05/11
- [Qemu-devel] [PULL 12/14] qtest: add memset to qtest protocol, John Snow, 2015/05/11
- [Qemu-devel] [PULL 11/14] qtest: Add base64 encoded read/write, John Snow, 2015/05/11