qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC 0/3] basic support for composing sysbus devi


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH RFC 0/3] basic support for composing sysbus devices
Date: Wed, 15 Jun 2011 15:00:52 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10

On 06/15/2011 01:56 PM, Blue Swirl wrote:
On Tue, Jun 14, 2011 at 4:21 PM, Anthony Liguori<address@hidden>  wrote:

Which suggests that we really need to move away from declarative device
definitions.  It makes it hard to have variable numbers of properties.

I'd suppose the number of slots could be fixed. Then the declaration could be
       DEFINE_PROP_SOCKETS(I440FXState, slot, 32),

That's fine for something like a PCI controller, but for something like a multiport network card, it's really desirable to be able to specify the number of ports as part of the config. IOW:

 -device virtio-net-pci,ports=8,netdev[0]=tap0,netdev[1]=tap1,...

In this case, piix3 would be defined as:

struct I440FXState {
    PIIX3 piix3;
    PCIDevice slots[32];
};

Which suggests we need an initfn to do the following:

void i440fx_initfn(...) {
   qdev_init_inplace(&dev->piix3, "PIIX3");
   dev->slot[1] =&dev->piix3->bus;
}

This gets hard to do well in C though.  I'm not sure how we could make
DEFINE_PROP_PLUG/SOCKET type safe.

DEFINE_PROP_PCI_SOCKET()?

Yeah, that's why I said, "hard to do well". It makes it very hard to add new socket types.

Regards,

Anthony Liguori






reply via email to

[Prev in Thread] Current Thread [Next in Thread]