[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 15/19] libqos/ahci: Add ahci_guest_io
From: |
John Snow |
Subject: |
[Qemu-devel] [PATCH v3 15/19] libqos/ahci: Add ahci_guest_io |
Date: |
Thu, 5 Feb 2015 12:41:26 -0500 |
ahci_guest_io is a shorthand function that will, in one shot,
execute a data command on the guest to the specified guest buffer
location, in the requested amount.
Signed-off-by: John Snow <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
---
tests/libqos/ahci.c | 15 +++++++++++++++
tests/libqos/ahci.h | 2 ++
2 files changed, 17 insertions(+)
diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c
index 2a5d8c4..f7713e1 100644
--- a/tests/libqos/ahci.c
+++ b/tests/libqos/ahci.c
@@ -548,6 +548,21 @@ inline unsigned size_to_prdtl(unsigned bytes, unsigned
bytes_per_prd)
return (bytes + bytes_per_prd - 1) / bytes_per_prd;
}
+/* Given a guest buffer address, perform an IO operation */
+void ahci_guest_io(AHCIQState *ahci, uint8_t port, uint8_t ide_cmd,
+ uint64_t buffer, size_t bufsize)
+{
+ AHCICommand *cmd;
+
+ cmd = ahci_command_create(ide_cmd);
+ ahci_command_set_buffer(cmd, buffer);
+ ahci_command_set_size(cmd, bufsize);
+ ahci_command_commit(ahci, cmd, port);
+ ahci_command_issue(ahci, cmd);
+ ahci_command_verify(ahci, cmd);
+ ahci_command_free(cmd);
+}
+
typedef struct AHCICommand {
/* Test Management Data */
uint8_t name;
diff --git a/tests/libqos/ahci.h b/tests/libqos/ahci.h
index 57ff344..1206c7a 100644
--- a/tests/libqos/ahci.h
+++ b/tests/libqos/ahci.h
@@ -521,6 +521,8 @@ void ahci_destroy_command(AHCIQState *ahci, uint8_t port,
uint8_t slot);
void ahci_write_fis(AHCIQState *ahci, RegH2DFIS *fis, uint64_t addr);
unsigned ahci_pick_cmd(AHCIQState *ahci, uint8_t port);
unsigned size_to_prdtl(unsigned bytes, unsigned bytes_per_prd);
+void ahci_guest_io(AHCIQState *ahci, uint8_t port, uint8_t ide_cmd,
+ uint64_t gbuffer, size_t size);
/* Command Lifecycle */
AHCICommand *ahci_command_create(uint8_t command_name);
--
1.9.3
- [Qemu-devel] [PATCH v3 13/19] libqos/ahci: add ahci command verify, (continued)
- [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, 2015/02/05
- [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 <=
- [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