qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH qom-next for-next 4/6] ipack: Simplify VMSTATE_IPACK


From: Andreas Färber
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

Hardcode name and offset to avoid having to pass parent_obj to it.

Signed-off-by: Andreas Färber <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]