aboutsummaryrefslogtreecommitdiff
path: root/tests/libqos
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2015-01-19 15:15:56 -0500
committerStefan Hajnoczi <stefanha@redhat.com>2015-02-16 14:40:55 +0000
commit6100ddb0f9776555b581455be4707f2077eee42f (patch)
treea8004df8fffcc639ba45590a6726c77aa33c3850 /tests/libqos
parent90e5add6f2fa0b0bd9a4c1d5a4de2304b5f3e466 (diff)
downloadqemu-6100ddb0f9776555b581455be4707f2077eee42f.zip
qemu-6100ddb0f9776555b581455be4707f2077eee42f.tar.gz
qemu-6100ddb0f9776555b581455be4707f2077eee42f.tar.bz2
qtest/ahci: Store hba_base in AHCIQState
Store the HBA memory base address in the new state object, to simplify function prototypes and encourage a more functional testing style. This causes a lot of churn, but this patch is as "simplified" as I could get it to be. This patch is therefore fairly mechanical and straightforward: Any case where we pass "hba_base" has been consolidated into the AHCIQState object and we pass the one unified parameter. Any case where we reference "ahci" and "hba_state" have been modified to use "ahci->dev" for the PCIDevice and "ahci->hba_state" to get at the base memory address, accordingly. Notes: - A needless return is removed from start_ahci_device. - For ease of reviewing, this patch can be reproduced (mostly) by: # Replace (ahci, hba_base) prototypes with unified parameter 's/(QPCIDevice \*ahci, void \*\?\*hba_base/(AHCIQState *ahci/' # Replace (ahci->dev, hba_base) calls with unified parameter 's/(ahci->dev, &\?hba_base)/(ahci)/' # Replace calls to PCI config space using "ahci" with "ahci->dev" 's/qpci_config_\(read\|write\)\(.\)(ahci,/qpci_config_\1\2(ahci->dev,/' After these, the remaining differences are easy to review by hand. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1421698563-6977-9-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'tests/libqos')
-rw-r--r--tests/libqos/ahci.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/libqos/ahci.h b/tests/libqos/ahci.h
index bc5f45d..e9e0206 100644
--- a/tests/libqos/ahci.h
+++ b/tests/libqos/ahci.h
@@ -248,6 +248,7 @@
typedef struct AHCIQState {
QOSState *parent;
QPCIDevice *dev;
+ void *hba_base;
} AHCIQState;
/**