mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
libvirt.c: Make VIR_MIGRATE_NON_SHARED_{INC,DISK} mutually exclusive
These two flags in fact are mutually exclusive. Requesting them both doesn't make any sense regardless of hypervisor driver. Hence, we have to make it within libvirt.c file instead of fixing it in each driver.
This commit is contained in:
parent
c47884a122
commit
c69331b500
@ -5161,6 +5161,10 @@ virDomainMigrateDirect(virDomainPtr domain,
|
||||
* XML includes details of the support URI schemes. If omitted
|
||||
* the dconn will be asked for a default URI.
|
||||
*
|
||||
* If you want to copy non-shared storage within migration you
|
||||
* can use either VIR_MIGRATE_NON_SHARED_DISK or
|
||||
* VIR_MIGRATE_NON_SHARED_INC as they are mutually exclusive.
|
||||
*
|
||||
* In either case it is typically only necessary to specify a
|
||||
* URI if the destination host has multiple interfaces and a
|
||||
* specific interface is required to transmit migration data.
|
||||
@ -5221,6 +5225,15 @@ virDomainMigrate(virDomainPtr domain,
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (flags & VIR_MIGRATE_NON_SHARED_DISK &&
|
||||
flags & VIR_MIGRATE_NON_SHARED_INC) {
|
||||
virReportInvalidArg(flags,
|
||||
_("flags 'shared disk' and 'shared incremental' "
|
||||
"in %s are mutually exclusive"),
|
||||
__FUNCTION__);
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (flags & VIR_MIGRATE_OFFLINE) {
|
||||
if (!VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
|
||||
VIR_DRV_FEATURE_MIGRATION_OFFLINE)) {
|
||||
@ -5375,6 +5388,10 @@ error:
|
||||
* XML includes details of the support URI schemes. If omitted
|
||||
* the dconn will be asked for a default URI.
|
||||
*
|
||||
* If you want to copy non-shared storage within migration you
|
||||
* can use either VIR_MIGRATE_NON_SHARED_DISK or
|
||||
* VIR_MIGRATE_NON_SHARED_INC as they are mutually exclusive.
|
||||
*
|
||||
* In either case it is typically only necessary to specify a
|
||||
* URI if the destination host has multiple interfaces and a
|
||||
* specific interface is required to transmit migration data.
|
||||
@ -5448,6 +5465,15 @@ virDomainMigrate2(virDomainPtr domain,
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (flags & VIR_MIGRATE_NON_SHARED_DISK &&
|
||||
flags & VIR_MIGRATE_NON_SHARED_INC) {
|
||||
virReportInvalidArg(flags,
|
||||
_("flags 'shared disk' and 'shared incremental' "
|
||||
"in %s are mutually exclusive"),
|
||||
__FUNCTION__);
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (flags & VIR_MIGRATE_OFFLINE) {
|
||||
if (!VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
|
||||
VIR_DRV_FEATURE_MIGRATION_OFFLINE)) {
|
||||
@ -5601,6 +5627,10 @@ error:
|
||||
*
|
||||
* VIR_MIGRATE_TUNNELLED requires that VIR_MIGRATE_PEER2PEER be set.
|
||||
*
|
||||
* If you want to copy non-shared storage within migration you
|
||||
* can use either VIR_MIGRATE_NON_SHARED_DISK or
|
||||
* VIR_MIGRATE_NON_SHARED_INC as they are mutually exclusive.
|
||||
*
|
||||
* If a hypervisor supports renaming domains during migration,
|
||||
* the dname parameter specifies the new name for the domain.
|
||||
* Setting dname to NULL keeps the domain name the same. If domain
|
||||
@ -5648,6 +5678,15 @@ virDomainMigrateToURI(virDomainPtr domain,
|
||||
|
||||
virCheckNonNullArgGoto(duri, error);
|
||||
|
||||
if (flags & VIR_MIGRATE_NON_SHARED_DISK &&
|
||||
flags & VIR_MIGRATE_NON_SHARED_INC) {
|
||||
virReportInvalidArg(flags,
|
||||
_("flags 'shared disk' and 'shared incremental' "
|
||||
"in %s are mutually exclusive"),
|
||||
__FUNCTION__);
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (flags & VIR_MIGRATE_OFFLINE &&
|
||||
!VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
|
||||
VIR_DRV_FEATURE_MIGRATION_OFFLINE)) {
|
||||
@ -5741,6 +5780,10 @@ error:
|
||||
*
|
||||
* VIR_MIGRATE_TUNNELLED requires that VIR_MIGRATE_PEER2PEER be set.
|
||||
*
|
||||
* If you want to copy non-shared storage within migration you
|
||||
* can use either VIR_MIGRATE_NON_SHARED_DISK or
|
||||
* VIR_MIGRATE_NON_SHARED_INC as they are mutually exclusive.
|
||||
*
|
||||
* If a hypervisor supports changing the configuration of the guest
|
||||
* during migration, the @dxml parameter specifies the new config
|
||||
* for the guest. The configuration must include an identical set
|
||||
@ -5799,6 +5842,15 @@ virDomainMigrateToURI2(virDomainPtr domain,
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (flags & VIR_MIGRATE_NON_SHARED_DISK &&
|
||||
flags & VIR_MIGRATE_NON_SHARED_INC) {
|
||||
virReportInvalidArg(flags,
|
||||
_("flags 'shared disk' and 'shared incremental' "
|
||||
"in %s are mutually exclusive"),
|
||||
__FUNCTION__);
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (flags & VIR_MIGRATE_PEER2PEER) {
|
||||
if (VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
|
||||
VIR_DRV_FEATURE_MIGRATION_P2P)) {
|
||||
|
Loading…
Reference in New Issue
Block a user