From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Jan Tomko <jtomko@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>,
Laszlo Ersek <lersek@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>, John Snow <jsnow@redhat.com>,
Richard Henderson <rth@twiddle.net>
Subject: [Qemu-devel] [PULL v2 09/16] hw/i386/pc: don't carry FDC from pc_basic_device_init() to pc_cmos_init()
Date: Wed, 8 Jul 2015 12:41:56 +0300 [thread overview]
Message-ID: <1436348444-907-10-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1436348444-907-1-git-send-email-mst@redhat.com>
From: Laszlo Ersek <lersek@redhat.com>
Thanks to the last patch, pc_cmos_init() doesn't need the (optional)
board-default FDC any longer as an input parameter. Update
pc_basic_device_init() not to hand it back to pc_init1() / pc_q35_init(),
and update the latter not to carry the FDC to pc_cmos_init(). This
simplifies the code.
pc_init1() | pc_q35_init()
pc_basic_device_init()
pc_cmos_init()
Cc: Jan Tomko <jtomko@redhat.com>
Cc: John Snow <jsnow@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
include/hw/i386/pc.h | 3 +--
hw/i386/pc.c | 7 ++++---
hw/i386/pc_piix.c | 5 ++---
hw/i386/pc_q35.c | 5 ++---
4 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index f9df68e..954e268 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -199,13 +199,12 @@ DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus);
void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
ISADevice **rtc_state,
bool create_fdctrl,
- ISADevice **floppy,
bool no_vmport,
uint32 hpet_irqs);
void pc_init_ne2k_isa(ISABus *bus, NICInfo *nd);
void pc_cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size,
const char *boot_device, MachineState *machine,
- ISADevice *floppy, BusState *ide0, BusState *ide1,
+ BusState *ide0, BusState *ide1,
ISADevice *s);
void pc_nic_init(ISABus *isa_bus, PCIBus *pci_bus);
void pc_pci_device_init(PCIBus *pci_bus);
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 09635cd..7661ea9 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -430,7 +430,7 @@ static void pc_cmos_init_late(void *opaque)
void pc_cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size,
const char *boot_device, MachineState *machine,
- ISADevice *floppy, BusState *idebus0, BusState *idebus1,
+ BusState *idebus0, BusState *idebus1,
ISADevice *s)
{
int val;
@@ -1463,7 +1463,6 @@ static const MemoryRegionOps ioportF0_io_ops = {
void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
ISADevice **rtc_state,
bool create_fdctrl,
- ISADevice **floppy,
bool no_vmport,
uint32 hpet_irqs)
{
@@ -1559,7 +1558,9 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
fd[i] = drive_get(IF_FLOPPY, 0, i);
create_fdctrl |= !!fd[i];
}
- *floppy = create_fdctrl ? fdctrl_init_isa(isa_bus, fd) : NULL;
+ if (create_fdctrl) {
+ fdctrl_init_isa(isa_bus, fd);
+ }
}
void pc_nic_init(ISABus *isa_bus, PCIBus *pci_bus)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 56cdcb9..0f99fdc 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -94,7 +94,6 @@ static void pc_init1(MachineState *machine)
DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
BusState *idebus[MAX_IDE_BUS];
ISADevice *rtc_state;
- ISADevice *floppy;
MemoryRegion *ram_memory;
MemoryRegion *pci_memory;
MemoryRegion *rom_memory;
@@ -241,7 +240,7 @@ static void pc_init1(MachineState *machine)
}
/* init basic PC hardware */
- pc_basic_device_init(isa_bus, gsi, &rtc_state, true, &floppy,
+ pc_basic_device_init(isa_bus, gsi, &rtc_state, true,
(pc_machine->vmport != ON_OFF_AUTO_ON), 0x4);
pc_nic_init(isa_bus, pci_bus);
@@ -273,7 +272,7 @@ static void pc_init1(MachineState *machine)
}
pc_cmos_init(below_4g_mem_size, above_4g_mem_size, machine->boot_order,
- machine, floppy, idebus[0], idebus[1], rtc_state);
+ machine, idebus[0], idebus[1], rtc_state);
if (pci_enabled && usb_enabled()) {
pci_create_simple(pci_bus, piix3_devfn + 2, "piix3-usb-uhci");
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 24ee086..e9cc96a 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -73,7 +73,6 @@ static void pc_q35_init(MachineState *machine)
PCIDevice *lpc;
BusState *idebus[MAX_SATA_PORTS];
ISADevice *rtc_state;
- ISADevice *floppy;
MemoryRegion *pci_memory;
MemoryRegion *rom_memory;
MemoryRegion *ram_memory;
@@ -249,7 +248,7 @@ static void pc_q35_init(MachineState *machine)
}
/* init basic PC hardware */
- pc_basic_device_init(isa_bus, gsi, &rtc_state, !mc->no_floppy, &floppy,
+ pc_basic_device_init(isa_bus, gsi, &rtc_state, !mc->no_floppy,
(pc_machine->vmport != ON_OFF_AUTO_ON), 0xff0104);
/* connect pm stuff to lpc */
@@ -278,7 +277,7 @@ static void pc_q35_init(MachineState *machine)
8, NULL, 0);
pc_cmos_init(below_4g_mem_size, above_4g_mem_size, machine->boot_order,
- machine, floppy, idebus[0], idebus[1], rtc_state);
+ machine, idebus[0], idebus[1], rtc_state);
/* the rest devices to which pci devfn is automatically assigned */
pc_vga_init(isa_bus, host_bus);
--
MST
next prev parent reply other threads:[~2015-07-08 9:42 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-08 9:41 [Qemu-devel] [PULL v2 00/16] pc,virtio,pci: fixes and updates Michael S. Tsirkin
2015-07-08 9:41 ` [Qemu-devel] [PULL v2 01/16] dataplane: fix cross-endian issues Michael S. Tsirkin
2015-07-08 9:41 ` [Qemu-devel] [PULL v2 02/16] Revert "dataplane: allow virtio-1 devices" Michael S. Tsirkin
2015-07-08 9:41 ` [Qemu-devel] [PULL v2 03/16] acpi: split out ICH ACPI support Michael S. Tsirkin
2015-07-08 9:41 ` [Qemu-devel] [PULL v2 04/16] ich9: add TCO interface emulation Michael S. Tsirkin
2015-07-13 9:49 ` Amit Shah
2015-07-08 9:41 ` [Qemu-devel] [PULL v2 05/16] tests: add testcase for TCO watchdog emulation Michael S. Tsirkin
2015-07-08 9:41 ` [Qemu-devel] [PULL v2 06/16] ich9: implement strap SPKR pin logic Michael S. Tsirkin
2015-07-08 9:41 ` [Qemu-devel] [PULL v2 07/16] hw/i386/pc: factor out pc_cmos_init_floppy() Michael S. Tsirkin
2015-07-08 9:41 ` [Qemu-devel] [PULL v2 08/16] hw/i386/pc: reflect any FDC @ ioport 0x3f0 in the CMOS Michael S. Tsirkin
2015-07-08 9:41 ` Michael S. Tsirkin [this message]
2015-07-08 9:42 ` [Qemu-devel] [PULL v2 10/16] virtio_net: reuse constants from linux Michael S. Tsirkin
2015-07-08 9:42 ` [Qemu-devel] [PULL v2 11/16] pci_regs.h: import " Michael S. Tsirkin
2015-07-08 9:42 ` [Qemu-devel] [PULL v2 12/16] pcie: Set the "link active" in the link status register Michael S. Tsirkin
2015-07-08 9:42 ` [Qemu-devel] [PULL v2 13/16] virtio: define virtio_pci_cfg_cap in header Michael S. Tsirkin
2015-07-08 9:42 ` [Qemu-devel] [PULL v2 14/16] virtio-pci: implement cfg capability Michael S. Tsirkin
2015-07-08 9:42 ` [Qemu-devel] [PULL v2 15/16] virtio fix cfg endian-ness for BE targets Michael S. Tsirkin
2015-07-08 9:42 ` [Qemu-devel] [PULL v2 16/16] tco-test: fix up config accesses and re-enable Michael S. Tsirkin
2015-07-08 13:47 ` [Qemu-devel] [PULL v2 00/16] pc,virtio,pci: fixes and updates Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1436348444-907-10-git-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=armbru@redhat.com \
--cc=ehabkost@redhat.com \
--cc=jsnow@redhat.com \
--cc=jtomko@redhat.com \
--cc=lersek@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).