qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 3/4] vl.c: Enable adding devices to the syste


From: Alistair Francis
Subject: Re: [Qemu-devel] [PATCH v2 3/4] vl.c: Enable adding devices to the system bus
Date: Mon, 14 Apr 2014 11:07:47 +1000

On Fri, Apr 11, 2014 at 5:45 PM, Peter Maydell <address@hidden> wrote:
> On 11 April 2014 07:34, Alistair Francis <address@hidden> wrote:
>> This removes the old method to connect devices and replaces it
>> with three calls to the three qdev-monitor functions added
>> in the previous patch.
>>
>> This allows complete machines to be built via the command line as
>> well as just attaching simple sysbus devices.
>
>>  static int device_init_func(QemuOpts *opts, void *opaque)
>>  {
>>      DeviceState *dev;
>> +    QEMUMachineInitArgs *current_machine = (QEMUMachineInitArgs *) opaque;
>> +    DeviceState *intc = current_machine->intc;
>>
>> -    dev = qdev_device_add(opts);
>> -    if (!dev)
>> -        return -1;
>> -    object_unref(OBJECT(dev));
>> +    dev = qdev_device_init(opts, intc);
>> +
>> +    if (dev && (dev->num_gpio_in > 32)) {
>> +        /* Store the Interupt Controller */
>> +        current_machine->intc = dev;
>> +    }
>
> What is this doing here?? Interrupt controllers should
> not be special cases, and they're certainly not
> guaranteed to be the only things with 32 GPIO
> inputs...
>
They are only special cases to connect the other devices to. This is not ideal
and I couldn't figure out any way to determine what the interrupt controller is.

As discussed in the other thread, this could be fixed with named GPIOs and that
is a much better idea

> thanks
> -- PMM
>



reply via email to

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