[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 26/28] pci: convert to QEMU Object Model
From: |
Michael S. Tsirkin |
Subject: |
Re: [Qemu-devel] [PATCH 26/28] pci: convert to QEMU Object Model |
Date: |
Wed, 25 Jan 2012 14:41:24 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Tue, Jan 24, 2012 at 01:33:18PM -0600, Anthony Liguori wrote:
> diff --git a/hw/ac97.c b/hw/ac97.c
> index 03be99b..33b85f5 100644
> --- a/hw/ac97.c
> +++ b/hw/ac97.c
> @@ -1344,21 +1344,30 @@ int ac97_init (PCIBus *bus)
> return 0;
> }
>
> -static PCIDeviceInfo ac97_info = {
> - .qdev.name = "AC97",
> - .qdev.desc = "Intel 82801AA AC97 Audio",
> - .qdev.size = sizeof (AC97LinkState),
> - .qdev.vmsd = &vmstate_ac97,
> - .init = ac97_initfn,
> - .exit = ac97_exitfn,
> - .vendor_id = PCI_VENDOR_ID_INTEL,
> - .device_id = PCI_DEVICE_ID_INTEL_82801AA_5,
> - .revision = 0x01,
> - .class_id = PCI_CLASS_MULTIMEDIA_AUDIO,
> - .qdev.props = (Property[]) {
> - DEFINE_PROP_UINT32("use_broken_id", AC97LinkState, use_broken_id, 0),
> - DEFINE_PROP_END_OF_LIST(),
> - }
> +static Property ac97_properties[] = {
> + DEFINE_PROP_UINT32("use_broken_id", AC97LinkState, use_broken_id, 0),
> + DEFINE_PROP_END_OF_LIST(),
> +};
> +
> +static void ac97_class_init(ObjectClass *klass, void *data)
> +{
> + PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
> +
> + k->init = ac97_initfn;
> + k->exit = ac97_exitfn;
> + k->vendor_id = PCI_VENDOR_ID_INTEL;
> + k->device_id = PCI_DEVICE_ID_INTEL_82801AA_5;
> + k->revision = 0x01;
> + k->class_id = PCI_CLASS_MULTIMEDIA_AUDIO;
> +}
> +
> +static DeviceInfo ac97_info = {
> + .name = "AC97",
> + .desc = "Intel 82801AA AC97 Audio",
> + .size = sizeof (AC97LinkState),
> + .vmsd = &vmstate_ac97,
> + .props = ac97_properties,
> + .class_init = ac97_class_init,
> };
>
> static void ac97_register (void)
So I have a question on this: the whole reason
we moved class, vendor id etc away from device init
functions to a table was to make it possible
to perform queries, like list all available sound device
types, or sort devices based on type, based on these tables.
Another purpose was to remove the manually written description/name,
embedding pci id database in qemu instead, and performing
lookups based on device/vendor id.
We never got these patches but it sounds like a genuinely useful
functionality.
Is this no longer possible?
--
MST
- Re: [Qemu-devel] [PATCH 27/28] sysbus: apic: ioapic: convert to QEMU Object Model, (continued)
- Re: [Qemu-devel] [PATCH 27/28] sysbus: apic: ioapic: convert to QEMU Object Model, Anthony Liguori, 2012/01/25
- Re: [Qemu-devel] [PATCH 27/28] sysbus: apic: ioapic: convert to QEMU Object Model, Jan Kiszka, 2012/01/25
- Re: [Qemu-devel] [PATCH 27/28] sysbus: apic: ioapic: convert to QEMU Object Model, Anthony Liguori, 2012/01/25
- Re: [Qemu-devel] [PATCH 27/28] sysbus: apic: ioapic: convert to QEMU Object Model, Andreas Färber, 2012/01/25
- Re: [Qemu-devel] [PATCH 27/28] sysbus: apic: ioapic: convert to QEMU Object Model, Eric Blake, 2012/01/25
[Qemu-devel] [PATCH 24/28] unin_pci: Drop duplicate busdev, Anthony Liguori, 2012/01/24
[Qemu-devel] [PATCH 26/28] pci: convert to QEMU Object Model, Anthony Liguori, 2012/01/24
- Re: [Qemu-devel] [PATCH 26/28] pci: convert to QEMU Object Model,
Michael S. Tsirkin <=
[Qemu-devel] [PATCH 12/28] isa: pic: convert to QEMU Object Model, Anthony Liguori, 2012/01/24
[Qemu-devel] [PATCH 02/28] openpic: remove dead code to make a PCI device version, Anthony Liguori, 2012/01/24
[Qemu-devel] [PATCH 28/28] virtio-s390: convert to QEMU Object Model, Anthony Liguori, 2012/01/24
[Qemu-devel] [PATCH 23/28] unin_pci: Clean up qdev names, Anthony Liguori, 2012/01/24
[Qemu-devel] [PATCH 07/28] qdev: don't access name through info, Anthony Liguori, 2012/01/24
[Qemu-devel] [PATCH 08/28] qdev: use a wrapper to access reset and promote reset to a class method, Anthony Liguori, 2012/01/24
[Qemu-devel] [PATCH 04/28] qom: add the base Object class (v2), Anthony Liguori, 2012/01/24