From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34718) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzOlq-0000Ol-Np for qemu-devel@nongnu.org; Mon, 01 Jun 2015 08:24:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzOlp-0007oT-MQ for qemu-devel@nongnu.org; Mon, 01 Jun 2015 08:24:46 -0400 Date: Mon, 1 Jun 2015 14:24:35 +0200 From: "Michael S. Tsirkin" Message-ID: <1433161230-29421-41-git-send-email-mst@redhat.com> References: <1433161230-29421-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1433161230-29421-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL v2 40/60] i386/pc: pc_basic_device_init(): delegate FDC creation request List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Peter Maydell , Eduardo Habkost , qemu-block@nongnu.org, Laszlo Ersek , Markus Armbruster , "Gabriel L. Somlo" , Gerd Hoffmann , Paolo Bonzini , John Snow , Richard Henderson From: Laszlo Ersek This patch introduces no observable change, but it allows the callers of pc_basic_device_init(), ie. pc_init1() and pc_q35_init(), to request (or not request) the creation of the FDC explicitly. At the moment both callers pass constant create_fdctrl=true (hence no observable change). Assuming a board passes create_fdctrl=false, "floppy" will be NULL on output, and (beyond the FDC not being created) that NULL will be passed on to pc_cmos_init(). Luckily, pc_cmos_init() already handles that case. Cc: Markus Armbruster Cc: Paolo Bonzini Cc: Gerd Hoffmann Cc: John Snow Cc: "Gabriel L. Somlo" Cc: "Michael S. Tsirkin" Cc: Kevin Wolf Cc: qemu-block@nongnu.org Signed-off-by: Laszlo Ersek Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Markus Armbruster --- include/hw/i386/pc.h | 1 + hw/i386/pc.c | 3 ++- hw/i386/pc_piix.c | 2 +- hw/i386/pc_q35.c | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 0510aea..27bd748 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -197,6 +197,7 @@ qemu_irq *pc_allocate_cpu_irq(void); 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); diff --git a/hw/i386/pc.c b/hw/i386/pc.c index aeed45d..b2fc501 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1395,6 +1395,7 @@ 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) @@ -1490,7 +1491,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi, for(i = 0; i < MAX_FD; i++) { fd[i] = drive_get(IF_FLOPPY, 0, i); } - *floppy = fdctrl_init_isa(isa_bus, fd); + *floppy = create_fdctrl ? fdctrl_init_isa(isa_bus, fd) : NULL; } 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 e77486c..6e7fa42 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -242,7 +242,7 @@ static void pc_init1(MachineState *machine) } /* init basic PC hardware */ - pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy, + pc_basic_device_init(isa_bus, gsi, &rtc_state, true, &floppy, (pc_machine->vmport != ON_OFF_AUTO_ON), 0x4); pc_nic_init(isa_bus, pci_bus); diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 68b4867..9ca317c 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -250,7 +250,7 @@ static void pc_q35_init(MachineState *machine) } /* init basic PC hardware */ - pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy, + pc_basic_device_init(isa_bus, gsi, &rtc_state, true, &floppy, (pc_machine->vmport != ON_OFF_AUTO_ON), 0xff0104); /* connect pm stuff to lpc */ -- MST