From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: "Alberto Garcia" <agarcia@igalia.com>,
"Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PATCH qom-next for-next 4/6] ipack: Simplify VMSTATE_IPACK_DEVICE() macro
Date: Fri, 2 Aug 2013 23:16:59 +0200 [thread overview]
Message-ID: <1375478221-22722-5-git-send-email-afaerber@suse.de> (raw)
In-Reply-To: <1375478221-22722-1-git-send-email-afaerber@suse.de>
Hardcode name and offset to avoid having to pass parent_obj to it.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/char/ipack.h | 10 ++++++++--
hw/char/ipoctal232.c | 2 +-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/hw/char/ipack.h b/hw/char/ipack.h
index 080767f..c183383 100644
--- a/hw/char/ipack.h
+++ b/hw/char/ipack.h
@@ -72,8 +72,14 @@ struct IPackDevice {
extern const VMStateDescription vmstate_ipack_device;
-#define VMSTATE_IPACK_DEVICE(_field, _state) \
- VMSTATE_STRUCT(_field, _state, 1, vmstate_ipack_device, IPackDevice)
+#define VMSTATE_IPACK_DEVICE() { \
+ .name = "parent_obj", \
+ .size = sizeof(IPackDevice), \
+ .version_id = 1, \
+ .vmsd = &vmstate_ipack_device, \
+ .flags = VMS_STRUCT, \
+ .offset = 0, \
+}
IPackDevice *ipack_device_find(IPackBus *bus, int32_t slot);
void ipack_bus_new_inplace(IPackBus *bus, DeviceState *parent,
diff --git a/hw/char/ipoctal232.c b/hw/char/ipoctal232.c
index 80ebe7b..08093da 100644
--- a/hw/char/ipoctal232.c
+++ b/hw/char/ipoctal232.c
@@ -156,7 +156,7 @@ static const VMStateDescription vmstate_ipoctal = {
.minimum_version_id = 1,
.minimum_version_id_old = 1,
.fields = (VMStateField[]) {
- VMSTATE_IPACK_DEVICE(dev, IPOctalState),
+ VMSTATE_IPACK_DEVICE(),
VMSTATE_STRUCT_ARRAY(ch, IPOctalState, N_CHANNELS, 1,
vmstate_scc2698_channel, SCC2698Channel),
VMSTATE_STRUCT_ARRAY(blk, IPOctalState, N_BLOCKS, 1,
--
1.8.1.4
next prev parent reply other threads:[~2013-08-02 21:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-02 21:16 [Qemu-devel] [PATCH qom-next for-next 0/6] QOM realize for IndustryPack Andreas Färber
2013-08-02 21:16 ` [Qemu-devel] [PATCH qom-next for-next 1/6] ipack: Convert to QOM realize Andreas Färber
2013-08-05 15:16 ` Alberto Garcia
2013-08-05 17:46 ` Andreas Färber
2013-08-02 21:16 ` [Qemu-devel] [PATCH qom-next for-next 2/6] ipack: QOM parent field cleanup for IPackBus Andreas Färber
2013-08-02 21:16 ` [Qemu-devel] [PATCH qom-next for-next 3/6] ipack: QOM parent field cleanup for IPackDevice Andreas Färber
2013-08-02 21:16 ` Andreas Färber [this message]
2013-08-02 21:17 ` [Qemu-devel] [PATCH qom-next for-next 5/6] ipoctal232: QOM parent field cleanup Andreas Färber
2013-08-02 21:17 ` [Qemu-devel] [PATCH qom-next for-next 6/6] ipack: Move IndustryPack out of hw/char/ Andreas Färber
2013-08-06 8:48 ` [Qemu-devel] [PATCH qom-next for-next 0/6] QOM realize for IndustryPack Alberto Garcia
2014-02-08 19:58 ` Andreas Färber
2014-02-08 23:31 ` Paolo Bonzini
2014-02-09 21:31 ` Paolo Bonzini
2014-02-09 21:46 ` Alberto Garcia
2014-02-09 22:12 ` Andreas Färber
2014-02-09 18:17 ` Alberto Garcia
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=1375478221-22722-5-git-send-email-afaerber@suse.de \
--to=afaerber@suse.de \
--cc=agarcia@igalia.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).