aboutsummaryrefslogtreecommitdiff
path: root/hw/core
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2019-10-16 10:29:30 +0800
committerJuan Quintela <quintela@redhat.com>2020-01-20 09:10:23 +0100
commit1df2c9a26fcb2fa32d099f8e9adcdae4207872e3 (patch)
tree1a970b94d94b70bad869dd4103961e2c7cd76b60 /hw/core
parent8bba004ccabd0d71e8b5ca056e576d2737c17305 (diff)
downloadqemu-1df2c9a26fcb2fa32d099f8e9adcdae4207872e3.zip
qemu-1df2c9a26fcb2fa32d099f8e9adcdae4207872e3.tar.gz
qemu-1df2c9a26fcb2fa32d099f8e9adcdae4207872e3.tar.bz2
migration: Define VMSTATE_INSTANCE_ID_ANY
Define the new macro VMSTATE_INSTANCE_ID_ANY for callers who wants to auto-generate the vmstate instance ID. Previously it was hard coded as -1 instead of this macro. It helps to change this default value in the follow up patches. No functional change. Signed-off-by: Peter Xu <peterx@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'hw/core')
-rw-r--r--hw/core/qdev.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 9f1753f..58e87d3 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -879,7 +879,8 @@ static void device_set_realized(Object *obj, bool value, Error **errp)
if (qdev_get_vmsd(dev)) {
if (vmstate_register_with_alias_id(VMSTATE_IF(dev),
- -1, qdev_get_vmsd(dev), dev,
+ VMSTATE_INSTANCE_ID_ANY,
+ qdev_get_vmsd(dev), dev,
dev->instance_id_alias,
dev->alias_required_for_version,
&local_err) < 0) {