qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3] qdev: move the code adding the device out of


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH v3] qdev: move the code adding the device out of realize
Date: Mon, 03 Mar 2014 16:56:19 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

Am 03.03.2014 14:34, schrieb Igor Mammedov:
> On Mon,  3 Mar 2014 15:57:55 +0800
> Amos Kong <address@hidden> wrote:
> 
> s/subj/qdev: set properties after device's parent is assigned/
> 
>> Test steps:
>>  (qemu) device_add e1000,addr=adsf
>>   Property 'e1000.addr' doesn't take value 'adsf'
>>  (qemu) info qtree
>>   Then qemu crashed.
>>
>> Currently we set a link to the new device for qdev parent bus, but the
>> device hasn't been added to QOM tree. When it fails to set properties,
>> object_unparent() can't cleanup the device.
>>
>> This patch moves the code adding the device output realize, when it fails
>> to set properties, the device can be cleaned successfully.
> Suggest rephrase as:
> Delay device property setting until device's parent is assigned. This way
> when property setting fails, object_unparent() can cleanup failed device
> properly.
> 
> with above correction:
> Reviewed-By: Igor Mammedov <address@hidden>
> 
>>
>> Signed-off-by: Amos Kong <address@hidden>
>> ---
>> V2: fix bz by adjust the initialization order (Paolo)
>> V3: fix bug without making it differs with legacy devices
>>     creation (Andreas)

Perfect, I've tweaked the commit message along the lines of Igor's
suggestion - please take a look if you want it changed differently:
https://github.com/afaerber/qemu-cpu/commits/qom-next

Thanks,
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

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