All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>,
	Thomas Huth <thuth@redhat.com>,
	ehabkost@redhat.com, mst@redhat.com, Li Qiang <liq3ea@gmail.com>,
	qemu-devel@nongnu.org, darren.kenny@oracle.com,
	pbonzini@redhat.com, rth@twiddle.net
Subject: Re: [Qemu-devel] [PATCH v3 2/2] hw: vmmouse: Use link instead of pointer property
Date: Tue, 18 Dec 2018 08:09:59 +0100	[thread overview]
Message-ID: <8736qvjooo.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <b3e3a763-7865-285b-4fa7-b3146f19d354@redhat.com> ("Philippe Mathieu-Daudé"'s message of "Mon, 17 Dec 2018 20:37:56 +0100")

Philippe Mathieu-Daudé <philmd@redhat.com> writes:

> On 12/17/18 8:01 PM, Markus Armbruster wrote:
>> Philippe Mathieu-Daudé <philmd@redhat.com> writes:
>> 
>>> Hi Li,
>>>
>>> On 11/29/18 5:52 AM, Li Qiang wrote:
>>>> According to qdev-properties.h, properties of pointer type should
>>>> be avoided. Turn "ps2_mouse" into a link.
>>>>
>>>> Reviewed-by: Markus Armbruster <armbru@redhat.com>
>>>> Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
>>>> Signed-off-by: Li Qiang <liq3ea@gmail.com>
>>>> ---
>> [...]
>>>> diff --git a/hw/i386/vmmouse.c b/hw/i386/vmmouse.c
>>>> index 4412eaf604..f63aac6673 100644
>>>> --- a/hw/i386/vmmouse.c
>>>> +++ b/hw/i386/vmmouse.c
>> [...]
>>>> @@ -283,8 +289,6 @@ static void vmmouse_class_initfn(ObjectClass *klass, void *data)
>>>>      dc->realize = vmmouse_realizefn;
>>>>      dc->reset = vmmouse_reset;
>>>>      dc->vmsd = &vmstate_vmmouse;
>>>> -    dc->props = vmmouse_properties;
>>>> -    /* Reason: pointer property "ps2_mouse" */
>>>>      dc->user_creatable = false;
>>>
>>> "user_creatable = false" must have an justification comment.
>> 
>> Correct.

Aside: more ->user_creatable = false without a comment have crept in
since I last swept them out.

>>> Can you keep 'Reason: link property "ps2_mouse"'?
>> 
>> Is this a valid reason?
>> 
>> A pointer property is one, because it can only be set by code.
>
> I prefer the original comment :)
>
> /* Reason: pointer property "ps2_mouse" */

A pointer property can't be set by -device because there's no sane way
to pick a value.  Not true for a link property: it's value is a QOM
path.  But I'm not sure such setting of link properties has been
implemented.  If it isn't, then /* Reason: link property "ps2_mouse */
is perfect.  If it isn, then it's wrong, possibly along with with
dc->user_creatable = false.

>>> Eventually the maintainer taking this patch can fix this for you.
>>>
>>> With the comment:
>>> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>>
>>>>  }
>> [...]
>> 

  reply	other threads:[~2018-12-18  7:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-29  4:52 [Qemu-devel] [PATCH v3 0/2] hw: vmmouse: use link property instead of DEFINE_PROP_PTR Li Qiang
2018-11-29  4:52 ` [Qemu-devel] [PATCH v3 1/2] hw: pc: use TYPE_XXX instead of constant strings Li Qiang
2018-12-17 12:32   ` Philippe Mathieu-Daudé
2018-11-29  4:52 ` [Qemu-devel] [PATCH v3 2/2] hw: vmmouse: Use link instead of pointer property Li Qiang
2018-12-17 12:43   ` Philippe Mathieu-Daudé
2018-12-17 19:01     ` Markus Armbruster
2018-12-17 19:37       ` Philippe Mathieu-Daudé
2018-12-18  7:09         ` Markus Armbruster [this message]
2018-12-18  8:49           ` Li Qiang
2018-12-17  1:10 ` [Qemu-devel] [PATCH v3 0/2] hw: vmmouse: use link property instead of DEFINE_PROP_PTR Li Qiang
2018-12-17  2:25   ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8736qvjooo.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=darren.kenny@oracle.com \
    --cc=ehabkost@redhat.com \
    --cc=liq3ea@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.