mirror of https://github.com/xemu-project/xemu.git
migration: register_savevm_live doesn't need dev
Commit 78dd48df3
removed the last caller of register_savevm_live for an
instantiable device (rather than a single system wide device);
so trim out the parameter.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20190822115433.12070-1-dgilbert@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
parent
fd418e520e
commit
ce62df5378
|
@ -183,8 +183,7 @@ another to load the state back.
|
||||||
|
|
||||||
.. code:: c
|
.. code:: c
|
||||||
|
|
||||||
int register_savevm_live(DeviceState *dev,
|
int register_savevm_live(const char *idstr,
|
||||||
const char *idstr,
|
|
||||||
int instance_id,
|
int instance_id,
|
||||||
int version_id,
|
int version_id,
|
||||||
SaveVMHandlers *ops,
|
SaveVMHandlers *ops,
|
||||||
|
|
|
@ -3078,7 +3078,7 @@ static void spapr_machine_init(MachineState *machine)
|
||||||
* interface, this is a legacy from the sPAPREnvironment structure
|
* interface, this is a legacy from the sPAPREnvironment structure
|
||||||
* which predated MachineState but had a similar function */
|
* which predated MachineState but had a similar function */
|
||||||
vmstate_register(NULL, 0, &vmstate_spapr, spapr);
|
vmstate_register(NULL, 0, &vmstate_spapr, spapr);
|
||||||
register_savevm_live(NULL, "spapr/htab", -1, 1,
|
register_savevm_live("spapr/htab", -1, 1,
|
||||||
&savevm_htab_handlers, spapr);
|
&savevm_htab_handlers, spapr);
|
||||||
|
|
||||||
qbus_set_hotplug_handler(sysbus_get_default(), OBJECT(machine),
|
qbus_set_hotplug_handler(sysbus_get_default(), OBJECT(machine),
|
||||||
|
|
|
@ -389,7 +389,7 @@ static inline void s390_skeys_set_migration_enabled(Object *obj, bool value,
|
||||||
ss->migration_enabled = value;
|
ss->migration_enabled = value;
|
||||||
|
|
||||||
if (ss->migration_enabled) {
|
if (ss->migration_enabled) {
|
||||||
register_savevm_live(NULL, TYPE_S390_SKEYS, 0, 1,
|
register_savevm_live(TYPE_S390_SKEYS, 0, 1,
|
||||||
&savevm_s390_storage_keys, ss);
|
&savevm_s390_storage_keys, ss);
|
||||||
} else {
|
} else {
|
||||||
unregister_savevm(DEVICE(ss), TYPE_S390_SKEYS, ss);
|
unregister_savevm(DEVICE(ss), TYPE_S390_SKEYS, ss);
|
||||||
|
|
|
@ -381,7 +381,7 @@ static void s390_stattrib_instance_init(Object *obj)
|
||||||
{
|
{
|
||||||
S390StAttribState *sas = S390_STATTRIB(obj);
|
S390StAttribState *sas = S390_STATTRIB(obj);
|
||||||
|
|
||||||
register_savevm_live(NULL, TYPE_S390_STATTRIB, 0, 0,
|
register_savevm_live(TYPE_S390_STATTRIB, 0, 0,
|
||||||
&savevm_s390_stattrib_handlers, sas);
|
&savevm_s390_stattrib_handlers, sas);
|
||||||
|
|
||||||
object_property_add_bool(obj, "migration-enabled",
|
object_property_add_bool(obj, "migration-enabled",
|
||||||
|
|
|
@ -101,7 +101,7 @@ static void s390_tod_realize(DeviceState *dev, Error **errp)
|
||||||
S390TODState *td = S390_TOD(dev);
|
S390TODState *td = S390_TOD(dev);
|
||||||
|
|
||||||
/* Legacy migration interface */
|
/* Legacy migration interface */
|
||||||
register_savevm_live(NULL, "todclock", 0, 1, &savevm_tod, td);
|
register_savevm_live("todclock", 0, 1, &savevm_tod, td);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void s390_tod_class_init(ObjectClass *oc, void *data)
|
static void s390_tod_class_init(ObjectClass *oc, void *data)
|
||||||
|
|
|
@ -68,8 +68,7 @@ typedef struct SaveVMHandlers {
|
||||||
int (*resume_prepare)(MigrationState *s, void *opaque);
|
int (*resume_prepare)(MigrationState *s, void *opaque);
|
||||||
} SaveVMHandlers;
|
} SaveVMHandlers;
|
||||||
|
|
||||||
int register_savevm_live(DeviceState *dev,
|
int register_savevm_live(const char *idstr,
|
||||||
const char *idstr,
|
|
||||||
int instance_id,
|
int instance_id,
|
||||||
int version_id,
|
int version_id,
|
||||||
const SaveVMHandlers *ops,
|
const SaveVMHandlers *ops,
|
||||||
|
|
|
@ -733,7 +733,7 @@ void dirty_bitmap_mig_init(void)
|
||||||
{
|
{
|
||||||
QSIMPLEQ_INIT(&dirty_bitmap_mig_state.dbms_list);
|
QSIMPLEQ_INIT(&dirty_bitmap_mig_state.dbms_list);
|
||||||
|
|
||||||
register_savevm_live(NULL, "dirty-bitmap", 0, 1,
|
register_savevm_live("dirty-bitmap", 0, 1,
|
||||||
&savevm_dirty_bitmap_handlers,
|
&savevm_dirty_bitmap_handlers,
|
||||||
&dirty_bitmap_mig_state);
|
&dirty_bitmap_mig_state);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1030,6 +1030,6 @@ void blk_mig_init(void)
|
||||||
QSIMPLEQ_INIT(&block_mig_state.blk_list);
|
QSIMPLEQ_INIT(&block_mig_state.blk_list);
|
||||||
qemu_mutex_init(&block_mig_state.lock);
|
qemu_mutex_init(&block_mig_state.lock);
|
||||||
|
|
||||||
register_savevm_live(NULL, "block", 0, 1, &savevm_block_handlers,
|
register_savevm_live("block", 0, 1, &savevm_block_handlers,
|
||||||
&block_mig_state);
|
&block_mig_state);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4675,5 +4675,5 @@ static SaveVMHandlers savevm_ram_handlers = {
|
||||||
void ram_mig_init(void)
|
void ram_mig_init(void)
|
||||||
{
|
{
|
||||||
qemu_mutex_init(&XBZRLE.lock);
|
qemu_mutex_init(&XBZRLE.lock);
|
||||||
register_savevm_live(NULL, "ram", 0, 4, &savevm_ram_handlers, &ram_state);
|
register_savevm_live("ram", 0, 4, &savevm_ram_handlers, &ram_state);
|
||||||
}
|
}
|
||||||
|
|
|
@ -684,8 +684,7 @@ static void savevm_state_handler_insert(SaveStateEntry *nse)
|
||||||
of the system, so instance_id should be removed/replaced.
|
of the system, so instance_id should be removed/replaced.
|
||||||
Meanwhile pass -1 as instance_id if you do not already have a clearly
|
Meanwhile pass -1 as instance_id if you do not already have a clearly
|
||||||
distinguishing id for all instances of your device class. */
|
distinguishing id for all instances of your device class. */
|
||||||
int register_savevm_live(DeviceState *dev,
|
int register_savevm_live(const char *idstr,
|
||||||
const char *idstr,
|
|
||||||
int instance_id,
|
int instance_id,
|
||||||
int version_id,
|
int version_id,
|
||||||
const SaveVMHandlers *ops,
|
const SaveVMHandlers *ops,
|
||||||
|
@ -704,26 +703,6 @@ int register_savevm_live(DeviceState *dev,
|
||||||
se->is_ram = 1;
|
se->is_ram = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dev) {
|
|
||||||
char *id = qdev_get_dev_path(dev);
|
|
||||||
if (id) {
|
|
||||||
if (snprintf(se->idstr, sizeof(se->idstr), "%s/", id) >=
|
|
||||||
sizeof(se->idstr)) {
|
|
||||||
error_report("Path too long for VMState (%s)", id);
|
|
||||||
g_free(id);
|
|
||||||
g_free(se);
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
g_free(id);
|
|
||||||
|
|
||||||
se->compat = g_new0(CompatEntry, 1);
|
|
||||||
pstrcpy(se->compat->idstr, sizeof(se->compat->idstr), idstr);
|
|
||||||
se->compat->instance_id = instance_id == -1 ?
|
|
||||||
calculate_compat_instance_id(idstr) : instance_id;
|
|
||||||
instance_id = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pstrcat(se->idstr, sizeof(se->idstr), idstr);
|
pstrcat(se->idstr, sizeof(se->idstr), idstr);
|
||||||
|
|
||||||
if (instance_id == -1) {
|
if (instance_id == -1) {
|
||||||
|
|
|
@ -576,7 +576,7 @@ static int net_slirp_init(NetClientState *peer, const char *model,
|
||||||
* specific version?
|
* specific version?
|
||||||
*/
|
*/
|
||||||
g_assert(slirp_state_version() == 4);
|
g_assert(slirp_state_version() == 4);
|
||||||
register_savevm_live(NULL, "slirp", 0, slirp_state_version(),
|
register_savevm_live("slirp", 0, slirp_state_version(),
|
||||||
&savevm_slirp_state, s->slirp);
|
&savevm_slirp_state, s->slirp);
|
||||||
|
|
||||||
s->poll_notifier.notify = net_slirp_poll_notify;
|
s->poll_notifier.notify = net_slirp_poll_notify;
|
||||||
|
|
Loading…
Reference in New Issue