aboutsummaryrefslogtreecommitdiff
path: root/hw/i386/pc.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2024-02-20 16:06:13 +0000
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2024-02-22 12:47:40 +0100
commit2df87da19091b3c4674a3d1504232a86dec7e529 (patch)
tree1d1a2f651ad53cdcdc448e0a0d999fa94e13f467 /hw/i386/pc.c
parent16bd024bb4af50e1aa8864a53807c0cc63092977 (diff)
downloadqemu-2df87da19091b3c4674a3d1504232a86dec7e529.zip
qemu-2df87da19091b3c4674a3d1504232a86dec7e529.tar.gz
qemu-2df87da19091b3c4674a3d1504232a86dec7e529.tar.bz2
hw/i386/pc: Store pointers to IDE buses in PCMachineState
Add the two IDE bus BusState pointers to the set we keep in PCMachineState. This allows us to avoid passing them to pc_cmos_init(), and also will allow a refactoring of how we call pc_cmos_init_late(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> [PMD: Do not zero-init pcms->idebus[] again] Message-ID: <20240220160622.114437-2-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'hw/i386/pc.c')
-rw-r--r--hw/i386/pc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 9cbc596..3e9ca62 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -574,7 +574,6 @@ static void pc_cmos_init_late(void *opaque)
}
void pc_cmos_init(PCMachineState *pcms,
- BusState *idebus0, BusState *idebus1,
ISADevice *rtc)
{
int val;
@@ -634,8 +633,8 @@ void pc_cmos_init(PCMachineState *pcms,
/* hard drives and FDC */
arg.rtc_state = s;
- arg.idebus[0] = idebus0;
- arg.idebus[1] = idebus1;
+ arg.idebus[0] = pcms->idebus[0];
+ arg.idebus[1] = pcms->idebus[1];
qemu_register_reset(pc_cmos_init_late, &arg);
}