qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>, qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Juan Quintela" <quintela@redhat.com>,
	"Andrew Jeffery" <andrew@aj.id.au>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Joel Stanley" <joel@jms.id.au>,
	"Andrew Baumann" <Andrew.Baumann@microsoft.com>,
	"Subbaraya Sundeep" <sundeep.lkml@gmail.com>,
	"Laurent Vivier" <laurent@vivier.eu>,
	qemu-arm@nongnu.org, "Cédric Le Goater" <clg@kaod.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Artyom Tarasenko" <atar4qemu@gmail.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>
Subject: [RFC PATCH v2 18/20] hw/core/qdev: Display warning for devices missing migration state
Date: Sun, 17 Jan 2021 20:24:44 +0100	[thread overview]
Message-ID: <20210117192446.23753-19-f4bug@amsat.org> (raw)
In-Reply-To: <20210117192446.23753-1-f4bug@amsat.org>

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é <f4bug@amsat.org>
---
Unresolved issue:

https://www.mail-archive.com/qemu-devel@nongnu.org/msg721700.html
Peter:
> I think where we'd like to get to is installing a migration
> blocker if the machine has any devices which don't have a vmsd.
> But for that we'd need to be pretty sure we'd got all the devices
> on machines where we care about migration, and we're clearly a
> fair way from that (eg we need to do something about the
> devices like the CPU which don't have a vmsd but handle their
> migration some other way so they don't trigger the condition
> for warning/migration-blocker).
---
 configure      | 10 ++++++++++
 meson.build    |  1 +
 hw/core/qdev.c |  5 +++++
 3 files changed, 16 insertions(+)

diff --git a/configure b/configure
index 155dda124c2..984befbb99d 100755
--- a/configure
+++ b/configure
@@ -383,6 +383,7 @@ blobs="true"
 pkgversion=""
 pie=""
 qom_cast_debug="yes"
+qdev_debug="no"
 trace_backends="log"
 trace_file="trace"
 spice="$default_feature"
@@ -1005,6 +1006,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="disabled"
   ;;
   --enable-virtfs) virtfs="enabled"
@@ -1048,6 +1053,7 @@ for opt do
       debug="yes"
       strip_opt="no"
       fortify_source="no"
+      qdev_debug="yes"
   ;;
   --enable-sanitizers) sanitizers="yes"
   ;;
@@ -5912,6 +5918,10 @@ 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
+
 echo "CONFIG_COROUTINE_BACKEND=$coroutine" >> $config_host_mak
 if test "$coroutine_pool" = "yes" ; then
   echo "CONFIG_COROUTINE_POOL=1" >> $config_host_mak
diff --git a/meson.build b/meson.build
index 3d889857a09..545c8f9f88b 100644
--- a/meson.build
+++ b/meson.build
@@ -2472,6 +2472,7 @@
 summary_info += {'TPM support':       config_host.has_key('CONFIG_TPM')}
 summary_info += {'libssh support':    config_host.has_key('CONFIG_LIBSSH')}
 summary_info += {'QOM debugging':     config_host.has_key('CONFIG_QOM_CAST_DEBUG')}
+summary_info += {'QDEV debugging':    config_host.has_key('CONFIG_QDEV_DEBUG')}
 summary_info += {'Live block migration': config_host.has_key('CONFIG_LIVE_BLOCK_MIGRATION')}
 summary_info += {'lzo support':       lzo.found()}
 summary_info += {'snappy support':    snappy.found()}
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index f0d0afd438d..9a73a242fa4 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -792,6 +792,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.26.2



  parent reply	other threads:[~2021-01-17 19:46 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-17 19:24 [RFC PATCH v2 00/20] hw: Mark the device with no migratable fields Philippe Mathieu-Daudé
2021-01-17 19:24 ` [RFC PATCH v2 01/20] migration/vmstate: Restrict vmstate_dummy to user-mode Philippe Mathieu-Daudé
2021-01-18 11:48   ` Dr. David Alan Gilbert
2021-01-19 13:50   ` Peter Maydell
2021-01-19 16:37     ` Philippe Mathieu-Daudé
2021-01-20 11:03       ` Dr. David Alan Gilbert
2021-01-17 19:24 ` [RFC PATCH v2 02/20] hw/core/qdev: Add vmstate_qdev_no_state_to_migrate Philippe Mathieu-Daudé
2021-01-19  9:31   ` Dr. David Alan Gilbert
2021-01-19 13:31   ` Peter Maydell
2021-01-17 19:24 ` [RFC PATCH v2 03/20] hw/arm/armv7m: Mark the device with no migratable fields Philippe Mathieu-Daudé
2021-01-17 19:24 ` [RFC PATCH v2 04/20] hw/arm/aspeed_soc: " Philippe Mathieu-Daudé
2021-01-26  7:09   ` Cédric Le Goater
2021-01-17 19:24 ` [RFC PATCH v2 05/20] hw/arm/bcm283x: Mark devices " Philippe Mathieu-Daudé
2021-01-17 19:24 ` [RFC PATCH v2 06/20] hw/arm/msf2-soc: Mark the device " Philippe Mathieu-Daudé
2021-01-17 19:24 ` [RFC PATCH v2 07/20] hw/core/split-irq: " Philippe Mathieu-Daudé
2021-01-17 19:24 ` [RFC PATCH v2 08/20] hw/cpu/a9mpcore: " Philippe Mathieu-Daudé
2021-01-17 19:24 ` [RFC PATCH v2 09/20] hw/cpu/cluster: " Philippe Mathieu-Daudé
2021-01-17 19:24 ` [RFC PATCH v2 10/20] hw/usb/hcd-ohci: " Philippe Mathieu-Daudé
2021-01-18 20:10   ` Dr. David Alan Gilbert
2021-01-17 19:24 ` [RFC PATCH v2 11/20] hw/intc/arm_gicv2m: " Philippe Mathieu-Daudé
2021-01-17 19:24 ` [RFC PATCH v2 12/20] hw/misc/armsse-cpuid: " Philippe Mathieu-Daudé
2021-01-17 19:24 ` [RFC PATCH v2 13/20] hw/misc/iotkit-sysinfo: " Philippe Mathieu-Daudé
2021-01-17 19:24 ` [RFC PATCH v2 14/20] hw/misc/unimp: " Philippe Mathieu-Daudé
2021-01-17 19:24 ` [RFC PATCH v2 15/20] hw/nubus/mac-nubus-bridge: " Philippe Mathieu-Daudé
2021-01-18 12:04   ` Laurent Vivier
2021-01-17 19:24 ` [RFC PATCH v2 16/20] hw/sparc64/sun4u: Mark devices " Philippe Mathieu-Daudé
2021-01-17 20:37   ` Artyom Tarasenko
2021-01-17 19:24 ` [RFC PATCH v2 17/20] hw/pci-host/gpex: Mark device " Philippe Mathieu-Daudé
2021-01-17 19:24 ` Philippe Mathieu-Daudé [this message]
2021-01-17 19:24 ` [RFC PATCH v2 19/20] stubs/vmstate: Add VMSTATE_END_OF_LIST to vmstate_user_mode_cpu_dummy Philippe Mathieu-Daudé
2021-01-20 10:56   ` Dr. David Alan Gilbert
2021-01-17 19:24 ` [RFC PATCH v2 20/20] migration/vmstate: Simplify vmstate for user-mode CPU Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210117192446.23753-19-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=Andrew.Baumann@microsoft.com \
    --cc=andrew@aj.id.au \
    --cc=atar4qemu@gmail.com \
    --cc=berrange@redhat.com \
    --cc=clg@kaod.org \
    --cc=dgilbert@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=joel@jms.id.au \
    --cc=kraxel@redhat.com \
    --cc=laurent@vivier.eu \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=sundeep.lkml@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).