[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Do not emulate a floppy drive when -nodefaults
From: |
Michael S. Tsirkin |
Subject: |
Re: [Qemu-devel] [PATCH] Do not emulate a floppy drive when -nodefaults |
Date: |
Wed, 13 May 2015 23:44:48 +0200 |
On Wed, May 13, 2015 at 06:29:46PM +0100, Stefano Stabellini wrote:
> Do not emulate a floppy drive if no drives are supposed to be present.
>
> This fixes the behavior of -nodefaults, that should remove the floppy
> drive (see docs/qdev-device-use.txt:Default Devices), but actually
> doesn't.
>
> Signed-off-by: Stefano Stabellini <address@hidden>
No telling what this might break. I think a flag or a property to
disable fdc would be safer. Default to enabled to make sure we
don't break existing users.
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index a8e6be1..c9f50b3 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -1410,6 +1410,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq
> *gsi,
> qemu_irq *cpu_exit_irq;
> MemoryRegion *ioport80_io = g_new(MemoryRegion, 1);
> MemoryRegion *ioportF0_io = g_new(MemoryRegion, 1);
> + bool floppy_exist;
>
> memory_region_init_io(ioport80_io, NULL, &ioport80_io_ops, NULL,
> "ioport80", 1);
> memory_region_add_subregion(isa_bus->address_space_io, 0x80,
> ioport80_io);
> @@ -1487,10 +1488,17 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq
> *gsi,
> cpu_exit_irq = qemu_allocate_irqs(cpu_request_exit, NULL, 1);
> DMA_init(0, cpu_exit_irq);
>
> + *floppy = NULL;
> + floppy_exist = false;
> for(i = 0; i < MAX_FD; i++) {
> fd[i] = drive_get(IF_FLOPPY, 0, i);
> + if (fd[i] != NULL) {
> + floppy_exist = true;
> + }
> + }
> + if (floppy_exist) {
> + *floppy = fdctrl_init_isa(isa_bus, fd);
> }
> - *floppy = fdctrl_init_isa(isa_bus, fd);
> }
>
> void pc_nic_init(ISABus *isa_bus, PCIBus *pci_bus)
- Re: [Qemu-devel] [PATCH] Do not emulate a floppy drive when -nodefaults, (continued)
- Re: [Qemu-devel] [PATCH] Do not emulate a floppy drive when -nodefaults, Kevin Wolf, 2015/05/18
- Re: [Qemu-devel] [PATCH] Do not emulate a floppy drive when -nodefaults, Michael S. Tsirkin, 2015/05/14
- Re: [Qemu-devel] [PATCH] Do not emulate a floppy drive when -nodefaults, Paolo Bonzini, 2015/05/14
- Re: [Qemu-devel] [PATCH] Do not emulate a floppy drive when -nodefaults, Michael S. Tsirkin, 2015/05/14
- Re: [Qemu-devel] [PATCH] Do not emulate a floppy drive when -nodefaults, Markus Armbruster, 2015/05/14
- Re: [Qemu-devel] [PATCH] Do not emulate a floppy drive when -nodefaults, Stefan Weil, 2015/05/14
- Re: [Qemu-devel] [PATCH] Do not emulate a floppy drive when -nodefaults, Michael S. Tsirkin, 2015/05/14
Re: [Qemu-devel] [PATCH] Do not emulate a floppy drive when -nodefaults,
Michael S. Tsirkin <=