/* Generic abstract object: */
+static SaveVMHandlers savevm_s390_stattrib_handlers = {
+ .save_setup = cmma_save_setup,
+ .save_live_iterate = cmma_save_iterate,
+ .save_live_complete_precopy = cmma_save_complete,
+ .state_pending_exact = cmma_state_pending,
+ .state_pending_estimate = cmma_state_pending,
+ .save_cleanup = cmma_save_cleanup,
+ .load_state = cmma_load,
+ .is_active = cmma_active,
+};
+
static void s390_stattrib_realize(DeviceState *dev, Error **errp)
{
bool ambiguous = false;
object_resolve_path_type("", TYPE_S390_STATTRIB, &ambiguous);
if (ambiguous) {
error_setg(errp, "storage_attributes device already exists");
+ return;
}
+
+ register_savevm_live(TYPE_S390_STATTRIB, 0, 0,
+ &savevm_s390_stattrib_handlers, dev);
}
static Property s390_stattrib_props[] = {
device_class_set_props(dc, s390_stattrib_props);
}
-static SaveVMHandlers savevm_s390_stattrib_handlers = {
- .save_setup = cmma_save_setup,
- .save_live_iterate = cmma_save_iterate,
- .save_live_complete_precopy = cmma_save_complete,
- .state_pending_exact = cmma_state_pending,
- .state_pending_estimate = cmma_state_pending,
- .save_cleanup = cmma_save_cleanup,
- .load_state = cmma_load,
- .is_active = cmma_active,
-};
-
static void s390_stattrib_instance_init(Object *obj)
{
S390StAttribState *sas = S390_STATTRIB(obj);
- register_savevm_live(TYPE_S390_STATTRIB, 0, 0,
- &savevm_s390_stattrib_handlers, sas);
-
sas->migration_cur_gfn = 0;
}