mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
Add support for unsafe migration
This patch adds VIR_MIGRATE_UNSAFE flag for migration APIs and new VIR_ERR_MIGRATION_UNSAFE error code. The error code should be returned whenever migrating a domain is considered unsafe (e.g., it's configured in a way that does not ensure data integrity once it is migrated). VIR_MIGRATE_UNSAFE flag may be used to force migration even though it would normally be considered unsafe and forbidden.
This commit is contained in:
parent
2b38e59bd8
commit
7808844dd1
@ -934,7 +934,7 @@ typedef enum {
|
||||
VIR_MIGRATE_CHANGE_PROTECTION = (1 << 8), /* protect for changing domain configuration through the
|
||||
* whole migration process; this will be used automatically
|
||||
* when supported */
|
||||
|
||||
VIR_MIGRATE_UNSAFE = (1 << 9), /* force migration even if it is considered unsafe */
|
||||
} virDomainMigrateFlags;
|
||||
|
||||
/* Domain migration. */
|
||||
|
@ -245,6 +245,7 @@ typedef enum {
|
||||
canceled/aborted by user */
|
||||
VIR_ERR_AUTH_CANCELLED = 79, /* authentication cancelled */
|
||||
VIR_ERR_NO_DOMAIN_METADATA = 80, /* The metadata is not present */
|
||||
VIR_ERR_MIGRATE_UNSAFE = 81, /* Migration is not safe */
|
||||
} virErrorNumber;
|
||||
|
||||
/**
|
||||
|
@ -5110,6 +5110,7 @@ virDomainMigrateDirect (virDomainPtr domain,
|
||||
* VIR_MIGRATE_CHANGE_PROTECTION Protect against domain configuration
|
||||
* changes during the migration process (set
|
||||
* automatically when supported).
|
||||
* VIR_MIGRATE_UNSAFE Force migration even if it is considered unsafe.
|
||||
*
|
||||
* VIR_MIGRATE_TUNNELLED requires that VIR_MIGRATE_PEER2PEER be set.
|
||||
* Applications using the VIR_MIGRATE_PEER2PEER flag will probably
|
||||
@ -5301,6 +5302,7 @@ error:
|
||||
* VIR_MIGRATE_CHANGE_PROTECTION Protect against domain configuration
|
||||
* changes during the migration process (set
|
||||
* automatically when supported).
|
||||
* VIR_MIGRATE_UNSAFE Force migration even if it is considered unsafe.
|
||||
*
|
||||
* VIR_MIGRATE_TUNNELLED requires that VIR_MIGRATE_PEER2PEER be set.
|
||||
* Applications using the VIR_MIGRATE_PEER2PEER flag will probably
|
||||
@ -5509,6 +5511,7 @@ error:
|
||||
* VIR_MIGRATE_CHANGE_PROTECTION Protect against domain configuration
|
||||
* changes during the migration process (set
|
||||
* automatically when supported).
|
||||
* VIR_MIGRATE_UNSAFE Force migration even if it is considered unsafe.
|
||||
*
|
||||
* The operation of this API hinges on the VIR_MIGRATE_PEER2PEER flag.
|
||||
* If the VIR_MIGRATE_PEER2PEER flag is NOT set, the duri parameter
|
||||
@ -5633,6 +5636,7 @@ error:
|
||||
* VIR_MIGRATE_CHANGE_PROTECTION Protect against domain configuration
|
||||
* changes during the migration process (set
|
||||
* automatically when supported).
|
||||
* VIR_MIGRATE_UNSAFE Force migration even if it is considered unsafe.
|
||||
*
|
||||
* The operation of this API hinges on the VIR_MIGRATE_PEER2PEER flag.
|
||||
*
|
||||
|
@ -1232,6 +1232,12 @@ virErrorMsg(virErrorNumber error, const char *info)
|
||||
else
|
||||
errmsg = _("metadata not found: %s");
|
||||
break;
|
||||
case VIR_ERR_MIGRATE_UNSAFE:
|
||||
if (!info)
|
||||
errmsg = _("Unsafe migration");
|
||||
else
|
||||
errmsg = _("Unsafe migration: %s");
|
||||
break;
|
||||
}
|
||||
return (errmsg);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user