From: "Andreas Färber" <afaerber@suse.de>
To: Luiz Capitulino <lcapitulino@redhat.com>,
Hani Benhabiles <kroosec@gmail.com>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-trivial@nongnu.org, imammedo@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-trivial] [PATCH] qmp: Remove unused variable.
Date: Fri, 25 Apr 2014 17:51:33 +0200 [thread overview]
Message-ID: <535A8485.7020809@suse.de> (raw)
In-Reply-To: <20140425114033.50333f11@redhat.com>
Am 25.04.2014 17:40, schrieb Luiz Capitulino:
> On Tue, 22 Apr 2014 22:44:03 +0100
> Hani Benhabiles <kroosec@gmail.com> wrote:
>
>> Signed-off-by: Hani Benhabiles <hani@linux.com>
>> ---
>> qmp.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/qmp.c b/qmp.c
>> index 87a28f7..44a6e17 100644
>> --- a/qmp.c
>> +++ b/qmp.c
>> @@ -194,11 +194,10 @@ void qmp_system_wakeup(Error **errp)
>> ObjectPropertyInfoList *qmp_qom_list(const char *path, Error **errp)
>> {
>> Object *obj;
>> - bool ambiguous = false;
>> ObjectPropertyInfoList *props = NULL;
>> ObjectProperty *prop;
>>
>> - obj = object_resolve_path(path, &ambiguous);
>> + obj = object_resolve_path(path, NULL);
>> if (obj == NULL) {
>> error_set(errp, QERR_DEVICE_NOT_FOUND, path);
>> return NULL;
>
> I'm under the impression that this check in object_resolve_partial_path():
>
> if (ambiguous && *ambiguous) {
> return NULL;
> }
>
> Uses 'ambiguous' internally. In that case, this change could have a side effect.
>
> But I'm not sure, I think it would be good to get a reviewed-by from
> a QOM expert.
Your understanding matches mine. I would propose to instead use the
variable in error reporting:
if (ambiguous) {
error_setg(errp, "Path '%s' is ambiguous.", path);
} else {
error_set(errp, QERR_DEVICE_NOT_FOUND, path);
}
My reasoning is that an ambiguous path might deliver unpredictable
results (whichever it encounters first), across QEMU versions at least.
But I'd like to hear Paolo's opinion, too, since he was involved in
loosening requirements on paths.
Regards,
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2014-04-25 15:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-22 21:44 [Qemu-trivial] [PATCH] qmp: Remove unused variable Hani Benhabiles
2014-04-24 15:19 ` Michael Tokarev
2014-04-25 15:40 ` Luiz Capitulino
2014-04-25 15:51 ` Andreas Färber [this message]
2014-04-26 0:46 ` Hani Benhabiles
2014-04-28 8:38 ` Paolo Bonzini
2014-04-28 8:37 ` Paolo Bonzini
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=535A8485.7020809@suse.de \
--to=afaerber@suse.de \
--cc=imammedo@redhat.com \
--cc=kroosec@gmail.com \
--cc=lcapitulino@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).