[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH-for-4.1] hw/ide/piix: Mark the PIIX IDE interfac
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-block] [PATCH-for-4.1] hw/ide/piix: Mark the PIIX IDE interfaces as not user_creatable |
Date: |
Thu, 18 Jul 2019 11:26:35 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 |
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é <address@hidden>
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;
> }
>
>