Skip to contentSkip to conversation

hw/ide/piix: Mark the PIIX IDE interfaces as not user_creatable

Qemu-devel Philippe Mathieu-Daudé 4 participants 4 messages Jul 18, 2019 – Jul 19, 2019

lore
Share & tools
lore
#0 lore raw

The 'piix3-ide' (and 'piix3-ide-xen') devices are part of the PIIX3 chipset modelled as TYPE_PIIX3_PCI_DEVICE (respectivelly TYPE_PIIX3_XEN_DEVICE). The PIIX3 chipset can not be created in part, it has to be created and used as a whole.

Similarly with the 'piix4-ide' device and the PIIX4 chipset modelled as TYPE_PIIX4_PCI_DEVICE.

Disable the 'user_creatable' flag.

part of TYPE_PIIX3_PCI_DEVICE (TYPE_PIIX3_XEN_DEVICE)

---
 hw/ide/piix.c | 2 ++
 1 file changed, 2 insertions(+)
hw/ide/piix.c +2 -0
index b97e555072..c02e768668 100644
@@ -253,6 +253,7 @@ static void piix3_ide_class_init(ObjectClass *klass, void *data)
     k->device_id = PCI_DEVICE_ID_INTEL_82371SB_1;
     k->class_id = PCI_CLASS_STORAGE_IDE;
     set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
+    dc->user_creatable = false;
     dc->hotpluggable = false;
 }
 
@@ -279,6 +280,7 @@ static void piix4_ide_class_init(ObjectClass *klass, void *data)
     k->device_id = PCI_DEVICE_ID_INTEL_82371AB;
     k->class_id = PCI_CLASS_STORAGE_IDE;
     set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
+    dc->user_creatable = false;
     dc->hotpluggable = false;
 }
 
Signature · 1 line
2.20.1
#1 lore raw
Quoted 5 lines · Philippe Mathieu-Daudé

The 'piix3-ide' (and 'piix3-ide-xen') devices are part of the PIIX3 chipset modelled as TYPE_PIIX3_PCI_DEVICE (respectivelly TYPE_PIIX3_XEN_DEVICE). The PIIX3 chipset can not be created in part, it has to be created and used as a whole.

Quoted 8 lines

Similarly with the 'piix4-ide' device and the PIIX4 chipset modelled as TYPE_PIIX4_PCI_DEVICE.

Disable the 'user_creatable' flag.

part of TYPE_PIIX3_PCI_DEVICE (TYPE_PIIX3_XEN_DEVICE)

This works though:

  qemu-system-x86_64 \
    -M q35,sata=off -device piix3-ide,addr=1f.2 \
    -drive if=none,file=freedos.raw,id=hd -device ide-hd,drive=hd

And it is a nice hack to mimic Q35's legacy IDE mode...

Paolo

Quoted 25 lines
---
 hw/ide/piix.c | 2 ++
 1 file changed, 2 insertions(+)
hw/ide/piix.c +2 -0
index b97e555072..c02e768668 100644
@@ -253,6 +253,7 @@ static void piix3_ide_class_init(ObjectClass *klass, void *data)
     k->device_id = PCI_DEVICE_ID_INTEL_82371SB_1;
     k->class_id = PCI_CLASS_STORAGE_IDE;
     set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
+    dc->user_creatable = false;
     dc->hotpluggable = false;
 }
 
@@ -279,6 +280,7 @@ static void piix4_ide_class_init(ObjectClass *klass, void *data)
     k->device_id = PCI_DEVICE_ID_INTEL_82371AB;
     k->class_id = PCI_CLASS_STORAGE_IDE;
     set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
+    dc->user_creatable = false;
     dc->hotpluggable = false;
 }
 
#2 lore raw

Am 18.07.2019 um 11:26 hat Paolo Bonzini geschrieben:

Quoted 15 lines · Philippe Mathieu-Daudé
Quoted 5 lines

The 'piix3-ide' (and 'piix3-ide-xen') devices are part of the PIIX3 chipset modelled as TYPE_PIIX3_PCI_DEVICE (respectivelly TYPE_PIIX3_XEN_DEVICE). The PIIX3 chipset can not be created in part, it has to be created and used as a whole.

Quoted 8 lines

Similarly with the 'piix4-ide' device and the PIIX4 chipset modelled as TYPE_PIIX4_PCI_DEVICE.

Disable the 'user_creatable' flag.

part of TYPE_PIIX3_PCI_DEVICE (TYPE_PIIX3_XEN_DEVICE)

Quoted 7 lines

This works though:

  qemu-system-x86_64 \
    -M q35,sata=off -device piix3-ide,addr=1f.2 \
    -drive if=none,file=freedos.raw,id=hd -device ide-hd,drive=hd

And it is a nice hack to mimic Q35's legacy IDE mode...

And I've seen it often enough that I'm sure users are using it.

If we want to remove it at all, we'd have to go through the usual deprecation period. But as long as we don't have another option for getting a legacy IDE controller on Q35, I don't think we should remove this.

Kevin

#3 lore raw
In reply to Paolo Bonzini
Quoted 17 lines · Paolo Bonzini
Quoted 5 lines · Philippe Mathieu-Daudé

The 'piix3-ide' (and 'piix3-ide-xen') devices are part of the PIIX3 chipset modelled as TYPE_PIIX3_PCI_DEVICE (respectivelly TYPE_PIIX3_XEN_DEVICE). The PIIX3 chipset can not be created in part, it has to be created and used as a whole.

Quoted 8 lines

Similarly with the 'piix4-ide' device and the PIIX4 chipset modelled as TYPE_PIIX4_PCI_DEVICE.

Disable the 'user_creatable' flag.

part of TYPE_PIIX3_PCI_DEVICE (TYPE_PIIX3_XEN_DEVICE)

This works though:

Quoted 8 lines
  qemu-system-x86_64 \
    -M q35,sata=off -device piix3-ide,addr=1f.2 \
    -drive if=none,file=freedos.raw,id=hd -device ide-hd,drive=hd

And it is a nice hack to mimic Q35's legacy IDE mode...

Paolo

Right. I never modeled the "right" way to do legacy IDE because I think it would involve some deeper surgery to the IDE code, and it was hard to justify the time spent.

Why do we want to disable these devices, exactly?

--js