qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2] qdev_try_create(): Assert that devices we pu


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v2] qdev_try_create(): Assert that devices we put onto the system bus are SysBusDevices
Date: Tue, 14 Jun 2016 15:41:49 +0100

On 11 May 2016 at 08:24, Markus Armbruster <address@hidden> wrote:
> Peter Maydell <address@hidden> writes:
>>  int qdev_hotplug = 0;
>> @@ -161,6 +162,12 @@ DeviceState *qdev_try_create(BusState *bus, const char 
>> *type)
>>      }
>>
>>      if (!bus) {
>> +        /* Assert that the device really is a SysBusDevice before
>> +         * we put it onto the sysbus. (Non-sysbus devices which aren't
>> +         * being put onto a bus should be created with object_new(TYPE_FOO),
>> +         * not qdev_create(NULL, TYPE_FOO).)
>
> Parenthesizing a sentence like this looks odd to me.  I'd drop the
> parens.
>
>> +         */
>> +        g_assert(object_dynamic_cast(OBJECT(dev), TYPE_SYS_BUS_DEVICE) != 
>> NULL);
>
> Long line, easy to fix: drop the redundant != NULL.
>
>>          bus = sysbus_get_default();
>>      }
>
> Just nits, no respin required.  Perhaps they can be addressed on commit.
>
> Reviewed-by: Markus Armbruster <address@hidden>

Thanks, I have fixed the minor nits and applied this to master.

-- PMM



reply via email to

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