From: Laszlo Ersek <lersek@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel@nongnu.org, Hu Tao <hutao@cn.fujitsu.com>
Subject: Re: [Qemu-devel] [PATCH 1/3] pvpanic: use FWCfgState explicitly
Date: Thu, 30 May 2013 17:05:51 +0200 [thread overview]
Message-ID: <51A76ACF.9050800@redhat.com> (raw)
In-Reply-To: <1369920427-18274-2-git-send-email-mst@redhat.com>
On 05/30/13 15:27, Michael S. Tsirkin wrote:
> Use the type-safe FWCfgState structure instead
> of the unsafe void *.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> hw/misc/pvpanic.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c
> index 31e1b1d..1483f27 100644
> --- a/hw/misc/pvpanic.c
> +++ b/hw/misc/pvpanic.c
> @@ -90,7 +90,7 @@ static int pvpanic_isa_initfn(ISADevice *dev)
> {
> PVPanicState *s = ISA_PVPANIC_DEVICE(dev);
> static bool port_configured;
> - void *fw_cfg;
> + FWCfgState *fw_cfg;
>
> memory_region_init_io(&s->io, &pvpanic_ops, s, "pvpanic", 1);
> isa_register_ioport(dev, &s->io, s->ioport);
>
Doesn't this break your build? Lower down in the function there's
fw_cfg = object_resolve_path("/machine/fw_cfg", NULL);
and object_resolve_path() returns a pointer-to-Object, not
pointer-to-FWCfgState.
But for starters I'm quite confused about how the unpatched function
works. What it does amounts to:
fw_cfg_add_file(object_resolve_path(...), ...);
But, again object_resolve_path() returns pointer-to-Object. I'm checking
"struct Object" in "include/qom/object.h", and it suggests that derived
structs should embed Object as first member. However FWCfgState is *not*
such a derived member. What's going on here?
http://thread.gmane.org/gmane.comp.emulators.qemu/201544/focus=201564
http://thread.gmane.org/gmane.comp.emulators.qemu/204452/focus=204450
Laszlo
next prev parent reply other threads:[~2013-05-30 15:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-30 13:27 [Qemu-devel] [PATCH 0/3] fw_cfg: misc fixes Michael S. Tsirkin
2013-05-30 13:27 ` [Qemu-devel] [PATCH 1/3] pvpanic: use FWCfgState explicitly Michael S. Tsirkin
2013-05-30 15:05 ` Laszlo Ersek [this message]
2013-05-30 15:41 ` Paolo Bonzini
2013-05-30 15:56 ` Laszlo Ersek
2013-05-30 16:03 ` Laszlo Ersek
2013-05-30 16:01 ` Paolo Bonzini
2013-05-30 17:36 ` Michael S. Tsirkin
2013-05-30 13:28 ` [Qemu-devel] [PATCH 2/3] fw_cfg: add API to find FW cfg object Michael S. Tsirkin
2013-05-30 16:06 ` Laszlo Ersek
2013-05-31 1:47 ` Hu Tao
2013-05-30 13:28 ` [Qemu-devel] [PATCH 3/3] fw_cfg: fw_cfg is a singleton Michael S. Tsirkin
2013-05-30 16:06 ` [Qemu-devel] [PATCH 0/3] fw_cfg: misc fixes Laszlo Ersek
2013-05-31 1:51 ` Hu Tao
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=51A76ACF.9050800@redhat.com \
--to=lersek@redhat.com \
--cc=hutao@cn.fujitsu.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@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).