mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 19:11:16 +00:00
migration: move implementation check to branches in p2p
This is more structured code so it will be easier to add branch for _PARAMS protocol here. It is not a pure refactoring strictly speaking as we remove scenarios for broken cases when driver defines V3 feature and implements perform function. So it is additionally a more solid code. Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
This commit is contained in:
parent
e17ae3ccc2
commit
341216a0af
@ -3339,23 +3339,25 @@ virDomainMigratePeer2PeerPlain(virDomainPtr domain,
|
|||||||
dconnuri, NULLSTR(xmlin), NULLSTR(dname), NULLSTR(uri),
|
dconnuri, NULLSTR(xmlin), NULLSTR(dname), NULLSTR(uri),
|
||||||
bandwidth, flags);
|
bandwidth, flags);
|
||||||
|
|
||||||
if (!domain->conn->driver->domainMigratePerform &&
|
|
||||||
!domain->conn->driver->domainMigratePerform3) {
|
|
||||||
virReportUnsupportedError();
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (virDomainMigrateCheckNotLocal(dconnuri) < 0)
|
if (virDomainMigrateCheckNotLocal(dconnuri) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
|
if (VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
|
||||||
VIR_DRV_FEATURE_MIGRATION_V3)) {
|
VIR_DRV_FEATURE_MIGRATION_V3)) {
|
||||||
VIR_DEBUG("Using migration protocol 3");
|
VIR_DEBUG("Using migration protocol 3");
|
||||||
|
if (!domain->conn->driver->domainMigratePerform3) {
|
||||||
|
virReportUnsupportedError();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
return domain->conn->driver->domainMigratePerform3
|
return domain->conn->driver->domainMigratePerform3
|
||||||
(domain, xmlin, NULL, 0, NULL, NULL, dconnuri,
|
(domain, xmlin, NULL, 0, NULL, NULL, dconnuri,
|
||||||
uri, flags, dname, bandwidth);
|
uri, flags, dname, bandwidth);
|
||||||
} else {
|
} else {
|
||||||
VIR_DEBUG("Using migration protocol 2");
|
VIR_DEBUG("Using migration protocol 2");
|
||||||
|
if (!domain->conn->driver->domainMigratePerform) {
|
||||||
|
virReportUnsupportedError();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
if (xmlin) {
|
if (xmlin) {
|
||||||
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
|
||||||
_("Unable to change target guest XML during "
|
_("Unable to change target guest XML during "
|
||||||
|
Loading…
Reference in New Issue
Block a user