[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/9] vmstate: complain about devices without vmstate
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 2/9] vmstate: complain about devices without vmstate |
Date: |
Wed, 20 Jul 2011 12:09:32 +0200 |
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/hw.h | 2 ++
hw/qdev.c | 7 ++++++-
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/hw/hw.h b/hw/hw.h
index df6ca65..d839af1 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -336,6 +336,8 @@ struct VMStateDescription {
const VMStateSubsection *subsections;
};
+#define VMSD_NONE ((const VMStateDescription*)1)
+
extern const VMStateInfo vmstate_info_bool;
extern const VMStateInfo vmstate_info_int8;
diff --git a/hw/qdev.c b/hw/qdev.c
index 292b52f..fafbbae 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -283,7 +283,12 @@ int qdev_init(DeviceState *dev)
qdev_free(dev);
return rc;
}
- if (dev->info->vmsd) {
+ if (dev->info->vmsd == NULL) {
+ /* TODO: fixup qemu source code, then make this an assert() */
+ error_report("WARNING: device %s has no vmstate\n", dev->info->name);
+ } else if (dev->info->vmsd == VMSD_NONE) {
+ /* device doesn't need vmstate */;
+ } else {
vmstate_register_with_alias_id(dev, -1, dev->info->vmsd, dev,
dev->instance_id_alias,
dev->alias_required_for_version);
--
1.7.1
- [Qemu-devel] [PULL] non-migratable devices, Gerd Hoffmann, 2011/07/20
- [Qemu-devel] [PATCH 2/9] vmstate: complain about devices without vmstate,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 1/9] vmstate: add no_migrate flag to VMStateDescription, Gerd Hoffmann, 2011/07/20
- [Qemu-devel] [PATCH 3/9] ahci doesn't support migration, Gerd Hoffmann, 2011/07/20
- [Qemu-devel] [PATCH 4/9] ehci doesn't support migration, Gerd Hoffmann, 2011/07/20
- [Qemu-devel] [PATCH 6/9] usb-wacom doesn't support migration, Gerd Hoffmann, 2011/07/20
- [Qemu-devel] [PATCH 5/9] usb storage: first migration support bits., Gerd Hoffmann, 2011/07/20
- [Qemu-devel] [PATCH 8/9] usb-net doesn't support migration, Gerd Hoffmann, 2011/07/20