mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
vmstate: replace DeviceState with VMStateIf
Replace DeviceState dependency with VMStateIf on vmstate API. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Acked-by: Halil Pasic <pasic@linux.ibm.com>
This commit is contained in:
parent
107b59698f
commit
3cad405bab
17 changed files with 41 additions and 38 deletions
|
@ -760,17 +760,17 @@ int register_savevm_live(const char *idstr,
|
|||
return 0;
|
||||
}
|
||||
|
||||
void unregister_savevm(DeviceState *dev, const char *idstr, void *opaque)
|
||||
void unregister_savevm(VMStateIf *obj, const char *idstr, void *opaque)
|
||||
{
|
||||
SaveStateEntry *se, *new_se;
|
||||
char id[256] = "";
|
||||
|
||||
if (dev) {
|
||||
char *path = qdev_get_dev_path(dev);
|
||||
if (path) {
|
||||
pstrcpy(id, sizeof(id), path);
|
||||
if (obj) {
|
||||
char *oid = vmstate_if_get_id(obj);
|
||||
if (oid) {
|
||||
pstrcpy(id, sizeof(id), oid);
|
||||
pstrcat(id, sizeof(id), "/");
|
||||
g_free(path);
|
||||
g_free(oid);
|
||||
}
|
||||
}
|
||||
pstrcat(id, sizeof(id), idstr);
|
||||
|
@ -784,7 +784,7 @@ void unregister_savevm(DeviceState *dev, const char *idstr, void *opaque)
|
|||
}
|
||||
}
|
||||
|
||||
int vmstate_register_with_alias_id(DeviceState *dev, int instance_id,
|
||||
int vmstate_register_with_alias_id(VMStateIf *obj, int instance_id,
|
||||
const VMStateDescription *vmsd,
|
||||
void *opaque, int alias_id,
|
||||
int required_for_version,
|
||||
|
@ -802,8 +802,8 @@ int vmstate_register_with_alias_id(DeviceState *dev, int instance_id,
|
|||
se->vmsd = vmsd;
|
||||
se->alias_id = alias_id;
|
||||
|
||||
if (dev) {
|
||||
char *id = qdev_get_dev_path(dev);
|
||||
if (obj) {
|
||||
char *id = vmstate_if_get_id(obj);
|
||||
if (id) {
|
||||
if (snprintf(se->idstr, sizeof(se->idstr), "%s/", id) >=
|
||||
sizeof(se->idstr)) {
|
||||
|
@ -834,7 +834,7 @@ int vmstate_register_with_alias_id(DeviceState *dev, int instance_id,
|
|||
return 0;
|
||||
}
|
||||
|
||||
void vmstate_unregister(DeviceState *dev, const VMStateDescription *vmsd,
|
||||
void vmstate_unregister(VMStateIf *obj, const VMStateDescription *vmsd,
|
||||
void *opaque)
|
||||
{
|
||||
SaveStateEntry *se, *new_se;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue