qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH-for-4.1] hw/ide/piix: Mark the PIIX IDE interfaces as not user_creatable
@ 2019-07-18  9:17 Philippe Mathieu-Daudé
  2019-07-18  9:26 ` Paolo Bonzini
  0 siblings, 1 reply; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-07-18  9:17 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, qemu-block, Michael S . Tsirkin, John Snow,
	Paolo Bonzini, 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.

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)

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/ide/piix.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index b97e555072..c02e768668 100644
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -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.20.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH-for-4.1] hw/ide/piix: Mark the PIIX IDE interfaces as not user_creatable
  2019-07-18  9:17 [Qemu-devel] [PATCH-for-4.1] hw/ide/piix: Mark the PIIX IDE interfaces as not user_creatable Philippe Mathieu-Daudé
@ 2019-07-18  9:26 ` Paolo Bonzini
  2019-07-18 12:12   ` [Qemu-devel] [Qemu-block] " Kevin Wolf
  2019-07-19  1:03   ` [Qemu-devel] " John Snow
  0 siblings, 2 replies; 4+ messages in thread
From: Paolo Bonzini @ 2019-07-18  9:26 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Thomas Huth, John Snow, qemu-block, Michael S . Tsirkin

On 18/07/19 11:17, Philippe Mathieu-Daudé wrote:
> 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)
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

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


> ---
>  hw/ide/piix.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/hw/ide/piix.c b/hw/ide/piix.c
> index b97e555072..c02e768668 100644
> --- a/hw/ide/piix.c
> +++ b/hw/ide/piix.c
> @@ -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;
>  }
>  
> 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [Qemu-block] [PATCH-for-4.1] hw/ide/piix: Mark the PIIX IDE interfaces as not user_creatable
  2019-07-18  9:26 ` Paolo Bonzini
@ 2019-07-18 12:12   ` Kevin Wolf
  2019-07-19  1:03   ` [Qemu-devel] " John Snow
  1 sibling, 0 replies; 4+ messages in thread
From: Kevin Wolf @ 2019-07-18 12:12 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Thomas Huth, Philippe Mathieu-Daudé,
	qemu-devel, qemu-block, Michael S . Tsirkin

Am 18.07.2019 um 11:26 hat Paolo Bonzini geschrieben:
> On 18/07/19 11:17, Philippe Mathieu-Daudé wrote:
> > 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)
> > 
> > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> 
> 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH-for-4.1] hw/ide/piix: Mark the PIIX IDE interfaces as not user_creatable
  2019-07-18  9:26 ` Paolo Bonzini
  2019-07-18 12:12   ` [Qemu-devel] [Qemu-block] " Kevin Wolf
@ 2019-07-19  1:03   ` John Snow
  1 sibling, 0 replies; 4+ messages in thread
From: John Snow @ 2019-07-19  1:03 UTC (permalink / raw)
  To: Paolo Bonzini, Philippe Mathieu-Daudé, qemu-devel
  Cc: Thomas Huth, qemu-block, Michael S . Tsirkin



On 7/18/19 5:26 AM, Paolo Bonzini wrote:
> On 18/07/19 11:17, Philippe Mathieu-Daudé wrote:
>> 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)
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> 
> 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
> 

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-07-19  1:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-18  9:17 [Qemu-devel] [PATCH-for-4.1] hw/ide/piix: Mark the PIIX IDE interfaces as not user_creatable Philippe Mathieu-Daudé
2019-07-18  9:26 ` Paolo Bonzini
2019-07-18 12:12   ` [Qemu-devel] [Qemu-block] " Kevin Wolf
2019-07-19  1:03   ` [Qemu-devel] " John Snow

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).