qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Mark Cave-Ayland <mark.caveayland@nutanix.com>
To: pbonzini@redhat.com, mst@redhat.com, marcel.apfelbaum@gmail.com,
	eduardo@habkost.net, imammedo@redhat.com, qemu-devel@nongnu.org
Subject: [PATCH v2 09/12] hw/i386/pc_piix.c: always initialise ISA IDE drives in pc_init_isa()
Date: Wed, 18 Jun 2025 12:27:14 +0100	[thread overview]
Message-ID: <20250618112828.235087-10-mark.caveayland@nutanix.com> (raw)
In-Reply-To: <20250618112828.235087-1-mark.caveayland@nutanix.com>

By definition an isapc machine must always use ISA IDE drives so ensure that they
are always enabled. At the same time also remove the surrounding CONFIG_IDE_ISA
define since it will be enabled via the ISAPC Kconfig.

Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
---
 hw/i386/pc_piix.c | 35 +++++++++++++++--------------------
 1 file changed, 15 insertions(+), 20 deletions(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 69c4c001cf..03bd09f680 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -427,6 +427,8 @@ static void pc_init_isa(MachineState *machine)
     GSIState *gsi_state;
     MemoryRegion *ram_memory;
     MemoryRegion *rom_memory = system_memory;
+    DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
+    int i;
 
     /*
      * There is no RAM split for the isapc machine
@@ -489,27 +491,20 @@ static void pc_init_isa(MachineState *machine)
 
     pc_nic_init(pcmc, isa_bus, pcms->pcibus);
 
-#ifdef CONFIG_IDE_ISA
-    if (!pcmc->pci_enabled) {
-        DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
-        int i;
-
-        ide_drive_get(hd, ARRAY_SIZE(hd));
-        for (i = 0; i < MAX_IDE_BUS; i++) {
-            ISADevice *dev;
-            char busname[] = "ide.0";
-            dev = isa_ide_init(isa_bus, ide_iobase[i], ide_iobase2[i],
-                               ide_irq[i],
-                               hd[MAX_IDE_DEVS * i], hd[MAX_IDE_DEVS * i + 1]);
-            /*
-             * The ide bus name is ide.0 for the first bus and ide.1 for the
-             * second one.
-             */
-            busname[4] = '0' + i;
-            pcms->idebus[i] = qdev_get_child_bus(DEVICE(dev), busname);
-        }
+    ide_drive_get(hd, ARRAY_SIZE(hd));
+    for (i = 0; i < MAX_IDE_BUS; i++) {
+        ISADevice *dev;
+        char busname[] = "ide.0";
+        dev = isa_ide_init(isa_bus, ide_iobase[i], ide_iobase2[i],
+                            ide_irq[i],
+                            hd[MAX_IDE_DEVS * i], hd[MAX_IDE_DEVS * i + 1]);
+        /*
+         * The ide bus name is ide.0 for the first bus and ide.1 for the
+         * second one.
+         */
+        busname[4] = '0' + i;
+        pcms->idebus[i] = qdev_get_child_bus(DEVICE(dev), busname);
     }
-#endif
 }
 #endif
 
-- 
2.43.0



  parent reply	other threads:[~2025-06-18 11:31 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-18 11:27 [PATCH v2 00/12] hw/i386: separate isapc out from pc_piix Mark Cave-Ayland
2025-06-18 11:27 ` [PATCH v2 01/12] hw/i386/pc_piix.c: duplicate pc_init1() into pc_isa_init() Mark Cave-Ayland
2025-06-19 20:47   ` Philippe Mathieu-Daudé
2025-06-18 11:27 ` [PATCH v2 02/12] hw/i386/pc_piix.c: remove pcmc->pci_enabled dependent initialisation from pc_init_isa() Mark Cave-Ayland
2025-06-19 20:47   ` Philippe Mathieu-Daudé
2025-06-18 11:27 ` [PATCH v2 03/12] hw/i386/pc_piix.c: remove SMI and piix4_pm " Mark Cave-Ayland
2025-06-19 20:46   ` Philippe Mathieu-Daudé
2025-06-18 11:27 ` [PATCH v2 04/12] hw/i386/pc_piix.c: remove SGX " Mark Cave-Ayland
2025-06-18 11:27 ` [PATCH v2 05/12] hw/i386/pc_piix.c: remove nvdimm " Mark Cave-Ayland
2025-06-19 20:46   ` Philippe Mathieu-Daudé
2025-06-18 11:27 ` [PATCH v2 06/12] hw/i386/pc_piix.c: simplify RAM size logic in pc_init_isa() Mark Cave-Ayland
2025-06-19 20:46   ` Philippe Mathieu-Daudé
2025-06-18 11:27 ` [PATCH v2 07/12] hw/i386/pc_piix.c: hardcode hole64_size to 0 " Mark Cave-Ayland
2025-06-19 20:44   ` Philippe Mathieu-Daudé
2025-06-18 11:27 ` [PATCH v2 08/12] hw/i386/pc_piix.c: remove pc_system_flash_cleanup_unused() from pc_init_isa() Mark Cave-Ayland
2025-06-18 11:27 ` Mark Cave-Ayland [this message]
2025-06-19 20:43   ` [PATCH v2 09/12] hw/i386/pc_piix.c: always initialise ISA IDE drives in pc_init_isa() Philippe Mathieu-Daudé
2025-06-18 11:27 ` [PATCH v2 10/12] hw/i386/pc_piix.c: assume pcmc->pci_enabled is always false " Mark Cave-Ayland
2025-06-19 20:42   ` Philippe Mathieu-Daudé
2025-06-23 10:51   ` Bernhard Beschow
2025-07-04 14:00     ` Mark Cave-Ayland
2025-06-18 11:27 ` [PATCH v2 11/12] hw/i386/pc_piix.c: hardcode pcms->pci_bus to NULL " Mark Cave-Ayland
2025-06-19 20:42   ` Philippe Mathieu-Daudé
2025-06-18 11:27 ` [PATCH v2 12/12] hw/i386: move isapc machine to separate isapc.c file Mark Cave-Ayland
2025-06-19 20:45   ` Philippe Mathieu-Daudé
2025-06-23 10:47   ` Bernhard Beschow
2025-07-04 13:58     ` Mark Cave-Ayland

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=20250618112828.235087-10-mark.caveayland@nutanix.com \
    --to=mark.caveayland@nutanix.com \
    --cc=eduardo@habkost.net \
    --cc=imammedo@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).