qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v5 4/5] qobject: modify qobject_ref() to return


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v5 4/5] qobject: modify qobject_ref() to return obj
Date: Thu, 19 Apr 2018 08:25:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Eric Blake <address@hidden> writes:

> On 04/17/2018 08:36 AM, Marc-André Lureau wrote:
>> For convenience and clarity, make it possible to call qobject_ref() at
>> the time when the reference is associated with a variable, or
>> argument, by making qobject_ref() return the same pointer as given.
>> 
>> Signed-off-by: Marc-André Lureau <address@hidden>
>> ---
>
>> +++ b/monitor.c
>
>> @@ -4049,8 +4046,7 @@ static void monitor_qmp_respond(Monitor *mon, QObject 
>> *rsp,
>>      if (rsp) {
>>          if (id) {
>>              /* This is for the qdict below. */
>> -            qobject_ref(id);
>> -            qdict_put_obj(qobject_to(QDict, rsp), "id", id);
>> +            qdict_put_obj(qobject_to(QDict, rsp), "id", qobject_ref(id));
>
> Is the comment still needed?  It made more sense when there were two
> statements, and now I think you can just delete it.

In my opinion, it didn't make much sense before, and less now.  Let's
drop it.

> Reviewed-by: Eric Blake <address@hidden>



reply via email to

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