From 6100ddb0f9776555b581455be4707f2077eee42f Mon Sep 17 00:00:00 2001 From: John Snow Date: Mon, 19 Jan 2015 15:15:56 -0500 Subject: 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 Reviewed-by: Paolo Bonzini Message-id: 1421698563-6977-9-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi --- tests/libqos/ahci.h | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/libqos/ahci.h') 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; /** -- cgit v1.1