qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 04/17] qdev: Give qtree names precedence over


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v3 04/17] qdev: Give qtree names precedence over user-assigned IDs
Date: Mon, 31 May 2010 13:12:40 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Gerd Hoffmann <address@hidden> writes:

>> pci_add nic -net use either the ID or option "name" of qemu_net_opts.
>> And there's our hole.  Reproducible with "-net user -net nic,id=foo
>> -device lsi,id=foo".
>
> Oh.  Well.  Yes, better plug that.
>
>> @@ -242,6 +243,10 @@ DeviceState *qdev_device_add(QemuOpts *opts)
>>       qdev = qdev_create_from_info(bus, info);
>>       id = qemu_opts_id(opts);
>>       if (id) {
>> +        if (qdev_find_recursive(main_system_bus, id)) {
>> +            qerror_report(QERR_DUPLICATE_ID, id, "device");
>> +            return NULL;
>> +        }
>>           qdev->id = id;
>>       }
>>       if (qemu_opt_foreach(opts, set_property, qdev, 1) != 0) {
>
> Looks good..
>
> Acked-by: Gerd Hoffmann <address@hidden>

I'll repost it as a well-formed patch.  While there, I'll outlaw "/".

What about requiring IDs to start with a letter?  Just in case we ever
want to add alias names that must not clash with user-specified IDs.



reply via email to

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