[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH qom-cpu v3 2/6] cpu: Introduce device_class_set_vmsd
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH qom-cpu v3 2/6] cpu: Introduce device_class_set_vmsd() helper |
Date: |
Tue, 18 Jun 2013 02:29:41 +0200 |
It's the equivalent to cpu_class_set_vmsd(), to assign
DeviceClass::vmsd. It wasn't needed before since only static,
unmigratable VMStateDescriptions were assigned so far.
Signed-off-by: Andreas Färber <address@hidden>
---
include/qom/cpu.h | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index 55a85c1..397219b 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -239,6 +239,27 @@ static inline void cpu_class_set_vmsd(CPUClass *cc,
#endif
/**
+ * device_class_set_vmsd:
+ * @dc: Device class
+ * @value: Value to set. Unused for %CONFIG_USER_ONLY.
+ *
+ * Sets #VMStateDescription for @dc.
+ *
+ * The @value argument is intentionally discarded for the non-softmmu targets
+ * to avoid linker errors or excessive preprocessor usage. If this behavior
+ * is undesired, you should assign #DeviceClass.vmsd directly instead.
+ */
+#ifndef CONFIG_USER_ONLY
+static inline void device_class_set_vmsd(DeviceClass *dc,
+ const struct VMStateDescription
*value)
+{
+ dc->vmsd = value;
+}
+#else
+#define device_class_set_vmsd(dc, value) ((dc)->vmsd = NULL)
+#endif
+
+/**
* qemu_cpu_has_work:
* @cpu: The vCPU to check.
*
--
1.8.1.4
- [Qemu-devel] [PATCH qom-cpu v3 0/6] QOM CPUState migration, next generation, Andreas Färber, 2013/06/17
- [Qemu-devel] [PATCH qom-cpu v3 1/6] cpu: Fix cpu_class_set_vmsd() documentation, Andreas Färber, 2013/06/17
- [Qemu-devel] [PATCH qom-cpu v3 3/6] cpu: Introduce VMSTATE_CPU() macro for CPUState, Andreas Färber, 2013/06/17
- [Qemu-devel] [PATCH qom-cpu v3 2/6] cpu: Introduce device_class_set_vmsd() helper,
Andreas Färber <=
- [Qemu-devel] [PATCH qom-cpu v3 4/6] target-alpha: Register VMStateDescription for AlphaCPU, Andreas Färber, 2013/06/17
- [Qemu-devel] [PATCH qom-cpu v3 6/6] cpu: Guard cpu_{save, load}() definitions, Andreas Färber, 2013/06/17
- [Qemu-devel] [PATCH qom-cpu v3 5/6] target-openrisc: Register VMStateDescription for OpenRISCCPU, Andreas Färber, 2013/06/17
- Re: [Qemu-devel] [PATCH qom-cpu v3 0/6] QOM CPUState migration, next generation, Andreas Färber, 2013/06/18