Skip to content

Commit

Permalink
vmstate_register_with_alias_id: Take an Error **
Browse files Browse the repository at this point in the history
I'll be adding an error to it in a subsequent patch.

Signed-off-by: Dr. David Alan Gilbert <[email protected]>
Reviewed-by: Juan Quintela <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Juan Quintela <[email protected]>
  • Loading branch information
dagrh authored and Juan Quintela committed Feb 6, 2017
1 parent b4b076d commit bc5c4f2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion hw/core/qdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,8 @@ static void device_set_realized(Object *obj, bool value, Error **errp)
if (qdev_get_vmsd(dev)) {
vmstate_register_with_alias_id(dev, -1, qdev_get_vmsd(dev), dev,
dev->instance_id_alias,
dev->alias_required_for_version);
dev->alias_required_for_version,
NULL);
}

QLIST_FOREACH(bus, &dev->child_bus, sibling) {
Expand Down
2 changes: 1 addition & 1 deletion hw/intc/apic_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ static void apic_common_realize(DeviceState *dev, Error **errp)
instance_id = -1;
}
vmstate_register_with_alias_id(NULL, instance_id, &vmstate_apic_common,
s, -1, 0);
s, -1, 0, NULL);
}

static void apic_common_unrealize(DeviceState *dev, Error **errp)
Expand Down
5 changes: 3 additions & 2 deletions include/migration/vmstate.h
Original file line number Diff line number Diff line change
Expand Up @@ -988,14 +988,15 @@ bool vmstate_save_needed(const VMStateDescription *vmsd, void *opaque);
int vmstate_register_with_alias_id(DeviceState *dev, int instance_id,
const VMStateDescription *vmsd,
void *base, int alias_id,
int required_for_version);
int required_for_version,
Error **errp);

static inline int vmstate_register(DeviceState *dev, int instance_id,
const VMStateDescription *vmsd,
void *opaque)
{
return vmstate_register_with_alias_id(dev, instance_id, vmsd,
opaque, -1, 0);
opaque, -1, 0, NULL);
}

void vmstate_unregister(DeviceState *dev, const VMStateDescription *vmsd,
Expand Down
3 changes: 2 additions & 1 deletion migration/savevm.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,8 @@ void unregister_savevm(DeviceState *dev, const char *idstr, void *opaque)
int vmstate_register_with_alias_id(DeviceState *dev, int instance_id,
const VMStateDescription *vmsd,
void *opaque, int alias_id,
int required_for_version)
int required_for_version,
Error **errp)
{
SaveStateEntry *se;

Expand Down
3 changes: 2 additions & 1 deletion stubs/vmstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ int vmstate_register_with_alias_id(DeviceState *dev,
int instance_id,
const VMStateDescription *vmsd,
void *base, int alias_id,
int required_for_version)
int required_for_version,
Error **errp)
{
return 0;
}
Expand Down

0 comments on commit bc5c4f2

Please sign in to comment.