[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 14/24] migration: Use device_class_set_props_n
From: |
Richard Henderson |
Subject: |
[PATCH 14/24] migration: Use device_class_set_props_n |
Date: |
Sun, 15 Dec 2024 21:50:59 -0600 |
Export the migration_properties array size from options.c;
use that to feed device_class_set_props_n. We must remove
DEFINE_PROP_END_OF_LIST so the count is correct.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
migration/options.h | 1 +
migration/migration.c | 3 ++-
migration/options.c | 2 +-
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/migration/options.h b/migration/options.h
index a360f93a44..762be4e641 100644
--- a/migration/options.h
+++ b/migration/options.h
@@ -21,6 +21,7 @@
/* migration properties */
extern const Property migration_properties[];
+extern const size_t migration_properties_count;
/* capabilities */
diff --git a/migration/migration.c b/migration/migration.c
index 6b3b85d31e..d23d392685 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -3822,7 +3822,8 @@ static void migration_class_init(ObjectClass *klass, void
*data)
DeviceClass *dc = DEVICE_CLASS(klass);
dc->user_creatable = false;
- (device_class_set_props)(dc, migration_properties);
+ device_class_set_props_n(dc, migration_properties,
+ migration_properties_count);
}
static void migration_instance_finalize(Object *obj)
diff --git a/migration/options.c b/migration/options.c
index 24cc8471aa..70ff56535a 100644
--- a/migration/options.c
+++ b/migration/options.c
@@ -196,8 +196,8 @@ const Property migration_properties[] = {
MIGRATION_CAPABILITY_SWITCHOVER_ACK),
DEFINE_PROP_MIG_CAP("x-dirty-limit", MIGRATION_CAPABILITY_DIRTY_LIMIT),
DEFINE_PROP_MIG_CAP("mapped-ram", MIGRATION_CAPABILITY_MAPPED_RAM),
- DEFINE_PROP_END_OF_LIST(),
};
+const size_t migration_properties_count = ARRAY_SIZE(migration_properties);
bool migrate_auto_converge(void)
{
--
2.43.0
- [PATCH 10/24] hw/sparc: Remove empty Property lists, (continued)
- [PATCH 10/24] hw/sparc: Remove empty Property lists, Richard Henderson, 2024/12/15
- [PATCH 08/24] hw/s390x: Remove empty Property lists, Richard Henderson, 2024/12/15
- [PATCH 09/24] hw/xen: Remove empty Property lists, Richard Henderson, 2024/12/15
- [PATCH 12/24] include/hw/qdev-core: Detect most empty Property lists at compile time, Richard Henderson, 2024/12/15
- [PATCH 13/24] hw/core: Introduce device_class_set_props_n, Richard Henderson, 2024/12/15
- [PATCH 11/24] hw/virtio: Remove empty Property lists, Richard Henderson, 2024/12/15
- [PATCH 15/24] hw/scsi/megasas: Use device_class_set_props_n, Richard Henderson, 2024/12/15
- [PATCH 16/24] hw/arm/armsse: Use device_class_set_props_n, Richard Henderson, 2024/12/15
- [PATCH 17/24] rust/qemu-api: Use device_class_set_props_n, Richard Henderson, 2024/12/15
- [PATCH 14/24] migration: Use device_class_set_props_n,
Richard Henderson <=
- [PATCH 19/24] target/riscv: Do not abuse DEFINE_PROP_END_OF_LIST, Richard Henderson, 2024/12/15
- [PATCH 18/24] hw/core: Replace device_class_set_props with a macro, Richard Henderson, 2024/12/15
- [PATCH 21/24] include/hw/qdev-properties: Shrink struct Property, Richard Henderson, 2024/12/15
- [PATCH 20/24] include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST, Richard Henderson, 2024/12/15
- [PATCH 22/24] hw/core/qdev-properties: Constify Property argument to object_field_prop_ptr, Richard Henderson, 2024/12/15
- [PATCH 23/24] hw/core/qdev-properties: Constify Property argument to PropertyInfo.print, Richard Henderson, 2024/12/15
- [PATCH 24/24] Constify all opaque Property pointers, Richard Henderson, 2024/12/15
- Re: [PATCH 00/24] More Property cleanups, Paolo Bonzini, 2024/12/18