vmstate: add no_migrate flag to VMStateDescription
This allows to easily tag devices as non-migratable, so any attempt to migrate a virtual machine with the device in question active will make migration fail. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
03ff09580e
commit
2837c8ea1f
1
hw/hw.h
1
hw/hw.h
|
@ -324,6 +324,7 @@ typedef struct VMStateSubsection {
|
||||||
|
|
||||||
struct VMStateDescription {
|
struct VMStateDescription {
|
||||||
const char *name;
|
const char *name;
|
||||||
|
int unmigratable;
|
||||||
int version_id;
|
int version_id;
|
||||||
int minimum_version_id;
|
int minimum_version_id;
|
||||||
int minimum_version_id_old;
|
int minimum_version_id_old;
|
||||||
|
|
1
savevm.c
1
savevm.c
|
@ -1234,6 +1234,7 @@ int vmstate_register_with_alias_id(DeviceState *dev, int instance_id,
|
||||||
se->opaque = opaque;
|
se->opaque = opaque;
|
||||||
se->vmsd = vmsd;
|
se->vmsd = vmsd;
|
||||||
se->alias_id = alias_id;
|
se->alias_id = alias_id;
|
||||||
|
se->no_migrate = vmsd->unmigratable;
|
||||||
|
|
||||||
if (dev && dev->parent_bus && dev->parent_bus->info->get_dev_path) {
|
if (dev && dev->parent_bus && dev->parent_bus->info->get_dev_path) {
|
||||||
char *id = dev->parent_bus->info->get_dev_path(dev);
|
char *id = dev->parent_bus->info->get_dev_path(dev);
|
||||||
|
|
Loading…
Reference in a new issue