migration: remove direct migration dependency on version1 of driver

Direct migration should work if *perform3 is present but *perform
is not. This is situation when driver migration is implemented
after new version of driver function is introduced. We should not
be forced to support old version too as its parameter space is
subspace of newer one.
This commit is contained in:
Michal Privoznik 2015-10-02 10:52:44 +03:00 committed by Jiri Denemark
parent 341216a0af
commit cba522caf7

View File

@ -3425,16 +3425,15 @@ virDomainMigrateDirect(virDomainPtr domain,
NULLSTR(xmlin), flags, NULLSTR(dname), NULLSTR(uri), NULLSTR(xmlin), flags, NULLSTR(dname), NULLSTR(uri),
bandwidth); bandwidth);
if (!domain->conn->driver->domainMigratePerform) {
virReportUnsupportedError();
return -1;
}
/* Perform the migration. The driver isn't supposed to return /* Perform the migration. The driver isn't supposed to return
* until the migration is complete. * until the migration is complete.
*/ */
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)) {
if (!domain->conn->driver->domainMigratePerform3) {
virReportUnsupportedError();
return -1;
}
VIR_DEBUG("Using migration protocol 3"); VIR_DEBUG("Using migration protocol 3");
/* dconn URI not relevant in direct migration, since no /* dconn URI not relevant in direct migration, since no
* target libvirtd is involved */ * target libvirtd is involved */
@ -3450,6 +3449,10 @@ virDomainMigrateDirect(virDomainPtr domain,
dname, dname,
bandwidth); bandwidth);
} else { } else {
if (!domain->conn->driver->domainMigratePerform) {
virReportUnsupportedError();
return -1;
}
VIR_DEBUG("Using migration protocol 2"); VIR_DEBUG("Using migration protocol 2");
if (xmlin) { if (xmlin) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",