summary refs log tree commit diff stats
path: root/hw/core/qdev.c
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dgilbert@redhat.com>2017-02-02 12:59:56 +0000
committerJuan Quintela <quintela@redhat.com>2017-02-06 13:36:49 +0100
commit67980031d234aa90524b83bb80bb5d1601d29076 (patch)
treeaa941b15cdb14471da67c99eec6042c0572f5484 /hw/core/qdev.c
parent581f08bac22bdd5e081ae07f68071a0fc3c5c2c7 (diff)
downloadfocaccia-qemu-67980031d234aa90524b83bb80bb5d1601d29076.tar.gz
focaccia-qemu-67980031d234aa90524b83bb80bb5d1601d29076.zip
vmstate registration: check return values
Check qdev's call to vmstate_register_with_alias_id; that gets
most of the common uses; there's hundreds of calls via vmstate_register
which could get fixed over time.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20170202125956.21942-4-dgilbert@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'hw/core/qdev.c')
-rw-r--r--hw/core/qdev.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index ea97b15f45..06ba02e2a3 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -933,10 +933,12 @@ static void device_set_realized(Object *obj, bool value, Error **errp)
         }
 
         if (qdev_get_vmsd(dev)) {
-            vmstate_register_with_alias_id(dev, -1, qdev_get_vmsd(dev), dev,
-                                           dev->instance_id_alias,
-                                           dev->alias_required_for_version,
-                                           NULL);
+            if (vmstate_register_with_alias_id(dev, -1, qdev_get_vmsd(dev), dev,
+                                               dev->instance_id_alias,
+                                               dev->alias_required_for_version,
+                                               &local_err) < 0) {
+                goto post_realize_fail;
+            }
         }
 
         QLIST_FOREACH(bus, &dev->child_bus, sibling) {