From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Eric Blake <eblake@redhat.com>
Cc: "Alistair Francis" <alistair.francis@xilinx.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Kevin Wolf" <kwolf@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Daniel P . Berrange" <berrange@redhat.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
"Edgar E . Iglesias" <edgar.iglesias@xilinx.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 1/4] sdbus: add a QMP command to access a SDBus
Date: Fri, 5 Jan 2018 18:28:51 -0300 [thread overview]
Message-ID: <CAAdtpL6jRV5J+0w07tFOuWcOet3vTky22Az8edV58eds5U1GFA@mail.gmail.com> (raw)
In-Reply-To: <58860a06-3d3f-ab2a-90ea-dd56dfbe9d79@redhat.com>
Hi Eric,
On Fri, Jan 5, 2018 at 12:29 PM, Eric Blake <eblake@redhat.com> wrote:
> On 01/03/2018 03:49 PM, Philippe Mathieu-Daudé wrote:
[...]
>> + if (ambiguous) {
>> + error_setg(errp, "Path '%s' is ambiguous", qom_path);
>> + } else {
>> + error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND,
>> + "Device '%s' not found", qom_path);
>> + }
>> + return NULL;
>> + }
>> + sdbus = (SDBus *)object_dynamic_cast(obj, TYPE_SD_BUS);
>
> Is the cast still necessary, or does object_dynamic_cast() return void*
> so that you can omit the cast?
Apparently the cast is necessary, since the object_dynamic_cast()
returns an Object pointer,
and the SD_BUS() macro uses object_dynamic_cast_assert() which
generates a runtime assert.
without casting:
hw/sd/sdbus-qmp.c:37:11: error: assignment from incompatible pointer
type [-Werror=incompatible-pointer-types]
sdbus = object_dynamic_cast(obj, TYPE_SD_BUS);
^
>
>> + if (sdbus == NULL) {
>> + error_set(errp, ERROR_CLASS_GENERIC_ERROR,
>> + "Device '%s' not a sd-bus", qom_path);
>> + return NULL;
>> + }
next prev parent reply other threads:[~2018-01-05 21:28 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-03 21:49 [Qemu-devel] [RFC PATCH v2 0/4] sdbus: testing sdcards Philippe Mathieu-Daudé
2018-01-03 21:49 ` [Qemu-devel] [PATCH v2 1/4] sdbus: add a QMP command to access a SDBus Philippe Mathieu-Daudé
2018-01-05 15:11 ` Stefan Hajnoczi
2018-01-05 15:29 ` Eric Blake
2018-01-05 16:06 ` Philippe Mathieu-Daudé
2018-01-05 16:10 ` Eric Blake
2018-01-05 21:28 ` Philippe Mathieu-Daudé [this message]
2019-03-08 16:11 ` Philippe Mathieu-Daudé
2019-03-11 11:49 ` Thomas Huth
2019-03-11 13:43 ` Eduardo Habkost
2019-03-11 13:48 ` Peter Maydell
2019-03-11 15:52 ` Markus Armbruster
2018-01-03 21:49 ` [Qemu-devel] [RFC PATCH v2 2/4] libqos: add a sdbus API Philippe Mathieu-Daudé
2018-01-05 15:18 ` Stefan Hajnoczi
2018-01-03 21:49 ` [Qemu-devel] [RFC PATCH v2 3/4] libqos: implement sdbus QMP driver Philippe Mathieu-Daudé
2018-01-05 15:25 ` Stefan Hajnoczi
2018-01-03 21:49 ` [Qemu-devel] [RFC PATCH v2 4/4] tests: add some sdcard qtest Philippe Mathieu-Daudé
2018-01-05 15:31 ` Stefan Hajnoczi
2018-01-05 15:55 ` Philippe Mathieu-Daudé
2018-01-08 14:32 ` Stefan Hajnoczi
2018-01-03 22:17 ` [Qemu-devel] [RFC PATCH v2 0/4] sdbus: testing sdcards no-reply
2018-01-05 15:32 ` Stefan Hajnoczi
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=CAAdtpL6jRV5J+0w07tFOuWcOet3vTky22Az8edV58eds5U1GFA@mail.gmail.com \
--to=f4bug@amsat.org \
--cc=alistair.francis@xilinx.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=eblake@redhat.com \
--cc=edgar.iglesias@xilinx.com \
--cc=ehabkost@redhat.com \
--cc=kwolf@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--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 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).