When built with --enable-qdev-debug, QEMU displays warnings
listing devices missing migration state:
$ qemu-system-arm -S -M spitz
qemu-system-arm: warning: missing migration state for type:
'pxa270-c0-arm-cpu'
qemu-system-arm: warning: missing migration state for type: 'serial'
qemu-system-arm: warning: missing migration state for type: 'pxa2xx-pcmcia'
qemu-system-arm: warning: missing migration state for type: 'pxa2xx-pcmcia'
qemu-system-arm: warning: missing migration state for type: 'pxa2xx-i2c-slave'
qemu-system-arm: warning: missing migration state for type: 'pxa2xx-i2c-slave'
qemu-system-arm: warning: missing migration state for type: 'ads7846'
qemu-system-arm: warning: missing migration state for type: 'max1111'
Signed-off-by: Philippe Mathieu-Daudé <f4...@amsat.org>
---
RFC because there might be something simpler than --enable-qdev-debug.
configure | 9 +++++++++
hw/core/qdev.c | 5 +++++
2 files changed, 14 insertions(+)
diff --git a/configure b/configure
index 8a65240d4a..d38efd5605 100755
--- a/configure
+++ b/configure
@@ -441,6 +441,7 @@ edk2_blobs="no"
pkgversion=""
pie=""
qom_cast_debug="yes"
+qdev_debug="no"
trace_backends="log"
trace_file="trace"
spice=""
@@ -1124,6 +1125,10 @@ for opt do
;;
--enable-qom-cast-debug) qom_cast_debug="yes"
;;
+ --disable-qdev-debug) qdev_debug="no"
+ ;;
+ --enable-qdev-debug) qdev_debug="yes"
+ ;;
--disable-virtfs) virtfs="no"
;;
--enable-virtfs) virtfs="yes"
@@ -6966,6 +6971,7 @@ echo "gcov enabled $gcov"
echo "TPM support $tpm"
echo "libssh support $libssh"
echo "QOM debugging $qom_cast_debug"
+echo "QDEV debugging $qdev_debug"
echo "Live block migration $live_block_migration"
echo "lzo support $lzo"
echo "snappy support $snappy"
@@ -7594,6 +7600,9 @@ fi
if test "$qom_cast_debug" = "yes" ; then
echo "CONFIG_QOM_CAST_DEBUG=y" >> $config_host_mak
fi
+if test "$qdev_debug" = "yes" ; then
+ echo "CONFIG_QDEV_DEBUG=y" >> $config_host_mak
+fi
if test "$rbd" = "yes" ; then
echo "CONFIG_RBD=m" >> $config_host_mak
echo "RBD_CFLAGS=$rbd_cflags" >> $config_host_mak
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 0d18bc6d93..c2da1e0509 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -932,6 +932,11 @@ static void device_set_realized(Object *obj, bool value,
Error **errp)
&local_err) < 0) {
goto post_realize_fail;
}
+ } else {
+#ifdef CONFIG_QDEV_DEBUG
+ warn_report("missing migration state for type: '%s'",
+ object_get_typename(OBJECT(dev)));
+#endif
}
/*
--
2.21.3