@@ -21,6 +21,7 @@
/* migration properties */
extern const Property migration_properties[];
+extern const size_t migration_properties_count;
/* capabilities */
@@ -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)
@@ -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)
{
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(-)