[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 07/97] vmstate: create test functions for versions u
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 07/97] vmstate: create test functions for versions until 15 |
Date: |
Mon, 7 Apr 2014 05:20:25 +0200 |
Using macros, just to avoid repeating code.
Signed-off-by: Juan Quintela <address@hidden>
---
include/migration/vmstate.h | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index e7e1705..001ff76 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -769,4 +769,26 @@ void vmstate_register_ram(struct MemoryRegion *memory,
DeviceState *dev);
void vmstate_unregister_ram(struct MemoryRegion *memory, DeviceState *dev);
void vmstate_register_ram_global(struct MemoryRegion *memory);
+/* version is X or bigger */
+#define VMSTATE_X_PLUS(X)\
+static inline bool vmstate_##X##_plus(void *opaque, int version_id)\
+{\
+ return version_id >= X;\
+}
+
+VMSTATE_X_PLUS(2)
+VMSTATE_X_PLUS(3)
+VMSTATE_X_PLUS(4)
+VMSTATE_X_PLUS(5)
+VMSTATE_X_PLUS(6)
+VMSTATE_X_PLUS(7)
+VMSTATE_X_PLUS(8)
+VMSTATE_X_PLUS(9)
+VMSTATE_X_PLUS(10)
+VMSTATE_X_PLUS(11)
+VMSTATE_X_PLUS(12)
+VMSTATE_X_PLUS(13)
+VMSTATE_X_PLUS(14)
+VMSTATE_X_PLUS(15)
+
#endif
--
1.9.0
- [Qemu-devel] [PATCH for 2.1 00/97] VMState simplification (massive), Juan Quintela, 2014/04/06
- [Qemu-devel] [PATCH 01/97] savevm: Ignore minimum_version_id_old if there is no load_state_old, Juan Quintela, 2014/04/06
- [Qemu-devel] [PATCH 03/97] vmstate: return error in case of error, Juan Quintela, 2014/04/06
- [Qemu-devel] [PATCH 05/97] vmstate: refactor opening of files, Juan Quintela, 2014/04/06
- [Qemu-devel] [PATCH 07/97] vmstate: create test functions for versions until 15,
Juan Quintela <=
- [Qemu-devel] [PATCH 04/97] vmstate: reduce code duplication, Juan Quintela, 2014/04/06
- [Qemu-devel] [PATCH 06/97] vmstate: Refactor & increase tests for primitive types, Juan Quintela, 2014/04/06
- [Qemu-devel] [PATCH 08/97] vmstate: Remove VMSTATE_UINTL_EQUAL_V, Juan Quintela, 2014/04/06
- [Qemu-devel] [PATCH 09/97] vmstate: Change VMSTATE_INTTL_V to VMSTATE_INTTL_TEST, Juan Quintela, 2014/04/06
- [Qemu-devel] [PATCH 10/97] vmstate: Remove unused VMSTATE_UINTTL_ARRAY_V, Juan Quintela, 2014/04/06
- [Qemu-devel] [PATCH 11/97] vmstate: Test for VMSTATE_BOOL_TEST, Juan Quintela, 2014/04/06
- [Qemu-devel] [PATCH 12/97] vmstate: Test for VMSTATE_INT8_TEST, Juan Quintela, 2014/04/06
- [Qemu-devel] [PATCH 02/97] savevm: Remove all the unneded version_minimum_id_old (Massive), Juan Quintela, 2014/04/06