提交 5379bb0f 编写于 作者: P Peter Krempa 提交者: Jiri Denemark

migration: Don't propagate VIR_MIGRATE_ABORT_ON_ERROR

This flag is meant for errors happening on the source of the migration
and isn't used on the destination. To allow better migration
compatibility, don't propagate it to the destination.
上级 cf6d56ac
...@@ -4554,6 +4554,8 @@ virDomainMigrateVersion1(virDomainPtr domain, ...@@ -4554,6 +4554,8 @@ virDomainMigrateVersion1(virDomainPtr domain,
char *cookie = NULL; char *cookie = NULL;
int cookielen = 0, ret; int cookielen = 0, ret;
virDomainInfo info; virDomainInfo info;
unsigned int destflags = flags & ~VIR_MIGRATE_ABORT_ON_ERROR;
VIR_DOMAIN_DEBUG(domain, VIR_DOMAIN_DEBUG(domain,
"dconn=%p, flags=%lx, dname=%s, uri=%s, bandwidth=%lu", "dconn=%p, flags=%lx, dname=%s, uri=%s, bandwidth=%lu",
dconn, flags, NULLSTR(dname), NULLSTR(uri), bandwidth); dconn, flags, NULLSTR(dname), NULLSTR(uri), bandwidth);
...@@ -4575,7 +4577,7 @@ virDomainMigrateVersion1(virDomainPtr domain, ...@@ -4575,7 +4577,7 @@ virDomainMigrateVersion1(virDomainPtr domain,
* the URI, it should leave uri_out as NULL. * the URI, it should leave uri_out as NULL.
*/ */
if (dconn->driver->domainMigratePrepare if (dconn->driver->domainMigratePrepare
(dconn, &cookie, &cookielen, uri, &uri_out, flags, dname, (dconn, &cookie, &cookielen, uri, &uri_out, destflags, dname,
bandwidth) == -1) bandwidth) == -1)
goto done; goto done;
...@@ -4602,7 +4604,7 @@ virDomainMigrateVersion1(virDomainPtr domain, ...@@ -4602,7 +4604,7 @@ virDomainMigrateVersion1(virDomainPtr domain,
dname = dname ? dname : domain->name; dname = dname ? dname : domain->name;
if (dconn->driver->domainMigrateFinish) if (dconn->driver->domainMigrateFinish)
ddomain = dconn->driver->domainMigrateFinish ddomain = dconn->driver->domainMigrateFinish
(dconn, dname, cookie, cookielen, uri, flags); (dconn, dname, cookie, cookielen, uri, destflags);
else else
ddomain = virDomainLookupByName(dconn, dname); ddomain = virDomainLookupByName(dconn, dname);
...@@ -4648,6 +4650,8 @@ virDomainMigrateVersion2(virDomainPtr domain, ...@@ -4648,6 +4650,8 @@ virDomainMigrateVersion2(virDomainPtr domain,
virErrorPtr orig_err = NULL; virErrorPtr orig_err = NULL;
unsigned int getxml_flags = 0; unsigned int getxml_flags = 0;
int cancelled; int cancelled;
unsigned int destflags = flags & ~VIR_MIGRATE_ABORT_ON_ERROR;
VIR_DOMAIN_DEBUG(domain, VIR_DOMAIN_DEBUG(domain,
"dconn=%p, flags=%lx, dname=%s, uri=%s, bandwidth=%lu", "dconn=%p, flags=%lx, dname=%s, uri=%s, bandwidth=%lu",
dconn, flags, NULLSTR(dname), NULLSTR(uri), bandwidth); dconn, flags, NULLSTR(dname), NULLSTR(uri), bandwidth);
...@@ -4692,7 +4696,7 @@ virDomainMigrateVersion2(virDomainPtr domain, ...@@ -4692,7 +4696,7 @@ virDomainMigrateVersion2(virDomainPtr domain,
VIR_DEBUG("Prepare2 %p flags=%lx", dconn, flags); VIR_DEBUG("Prepare2 %p flags=%lx", dconn, flags);
ret = dconn->driver->domainMigratePrepare2 ret = dconn->driver->domainMigratePrepare2
(dconn, &cookie, &cookielen, uri, &uri_out, flags, dname, (dconn, &cookie, &cookielen, uri, &uri_out, destflags, dname,
bandwidth, dom_xml); bandwidth, dom_xml);
VIR_FREE(dom_xml); VIR_FREE(dom_xml);
if (ret == -1) if (ret == -1)
...@@ -4732,7 +4736,7 @@ finish: ...@@ -4732,7 +4736,7 @@ finish:
dname = dname ? dname : domain->name; dname = dname ? dname : domain->name;
VIR_DEBUG("Finish2 %p ret=%d", dconn, ret); VIR_DEBUG("Finish2 %p ret=%d", dconn, ret);
ddomain = dconn->driver->domainMigrateFinish2 ddomain = dconn->driver->domainMigrateFinish2
(dconn, dname, cookie, cookielen, uri, flags, cancelled); (dconn, dname, cookie, cookielen, uri, destflags, cancelled);
done: done:
if (orig_err) { if (orig_err) {
...@@ -4791,6 +4795,7 @@ virDomainMigrateVersion3(virDomainPtr domain, ...@@ -4791,6 +4795,7 @@ virDomainMigrateVersion3(virDomainPtr domain,
int cancelled = 1; int cancelled = 1;
unsigned long protection = 0; unsigned long protection = 0;
bool notify_source = true; bool notify_source = true;
unsigned int destflags = flags & ~VIR_MIGRATE_ABORT_ON_ERROR;
VIR_DOMAIN_DEBUG(domain, "dconn=%p xmlin=%s, flags=%lx, " VIR_DOMAIN_DEBUG(domain, "dconn=%p xmlin=%s, flags=%lx, "
"dname=%s, uri=%s, bandwidth=%lu", "dname=%s, uri=%s, bandwidth=%lu",
...@@ -4830,7 +4835,7 @@ virDomainMigrateVersion3(virDomainPtr domain, ...@@ -4830,7 +4835,7 @@ virDomainMigrateVersion3(virDomainPtr domain,
cookieoutlen = 0; cookieoutlen = 0;
ret = dconn->driver->domainMigratePrepare3 ret = dconn->driver->domainMigratePrepare3
(dconn, cookiein, cookieinlen, &cookieout, &cookieoutlen, (dconn, cookiein, cookieinlen, &cookieout, &cookieoutlen,
uri, &uri_out, flags, dname, bandwidth, dom_xml); uri, &uri_out, destflags, dname, bandwidth, dom_xml);
VIR_FREE(dom_xml); VIR_FREE(dom_xml);
if (ret == -1) { if (ret == -1) {
if (protection) { if (protection) {
...@@ -4908,7 +4913,7 @@ finish: ...@@ -4908,7 +4913,7 @@ finish:
dname = dname ? dname : domain->name; dname = dname ? dname : domain->name;
ddomain = dconn->driver->domainMigrateFinish3 ddomain = dconn->driver->domainMigrateFinish3
(dconn, dname, cookiein, cookieinlen, &cookieout, &cookieoutlen, (dconn, dname, cookiein, cookieinlen, &cookieout, &cookieoutlen,
NULL, uri, flags, cancelled); NULL, uri, destflags, cancelled);
/* If ddomain is NULL, then we were unable to start /* If ddomain is NULL, then we were unable to start
* the guest on the target, and must restart on the * the guest on the target, and must restart on the
......
...@@ -3183,6 +3183,8 @@ static int doPeer2PeerMigrate2(virQEMUDriverPtr driver, ...@@ -3183,6 +3183,8 @@ static int doPeer2PeerMigrate2(virQEMUDriverPtr driver,
virErrorPtr orig_err = NULL; virErrorPtr orig_err = NULL;
bool cancelled; bool cancelled;
virStreamPtr st = NULL; virStreamPtr st = NULL;
unsigned int destflags = flags & ~VIR_MIGRATE_ABORT_ON_ERROR;
VIR_DEBUG("driver=%p, sconn=%p, dconn=%p, vm=%p, dconnuri=%s, " VIR_DEBUG("driver=%p, sconn=%p, dconn=%p, vm=%p, dconnuri=%s, "
"flags=%lx, dname=%s, resource=%lu", "flags=%lx, dname=%s, resource=%lu",
driver, sconn, dconn, vm, NULLSTR(dconnuri), driver, sconn, dconn, vm, NULLSTR(dconnuri),
...@@ -3212,13 +3214,13 @@ static int doPeer2PeerMigrate2(virQEMUDriverPtr driver, ...@@ -3212,13 +3214,13 @@ static int doPeer2PeerMigrate2(virQEMUDriverPtr driver,
qemuDomainObjEnterRemote(vm); qemuDomainObjEnterRemote(vm);
ret = dconn->driver->domainMigratePrepareTunnel ret = dconn->driver->domainMigratePrepareTunnel
(dconn, st, flags, dname, resource, dom_xml); (dconn, st, destflags, dname, resource, dom_xml);
qemuDomainObjExitRemote(vm); qemuDomainObjExitRemote(vm);
} else { } else {
qemuDomainObjEnterRemote(vm); qemuDomainObjEnterRemote(vm);
ret = dconn->driver->domainMigratePrepare2 ret = dconn->driver->domainMigratePrepare2
(dconn, &cookie, &cookielen, NULL, &uri_out, (dconn, &cookie, &cookielen, NULL, &uri_out,
flags, dname, resource, dom_xml); destflags, dname, resource, dom_xml);
qemuDomainObjExitRemote(vm); qemuDomainObjExitRemote(vm);
} }
VIR_FREE(dom_xml); VIR_FREE(dom_xml);
...@@ -3276,7 +3278,7 @@ finish: ...@@ -3276,7 +3278,7 @@ finish:
qemuDomainObjEnterRemote(vm); qemuDomainObjEnterRemote(vm);
ddomain = dconn->driver->domainMigrateFinish2 ddomain = dconn->driver->domainMigrateFinish2
(dconn, dname, cookie, cookielen, (dconn, dname, cookie, cookielen,
uri_out ? uri_out : dconnuri, flags, cancelled); uri_out ? uri_out : dconnuri, destflags, cancelled);
qemuDomainObjExitRemote(vm); qemuDomainObjExitRemote(vm);
cleanup: cleanup:
...@@ -3326,6 +3328,8 @@ static int doPeer2PeerMigrate3(virQEMUDriverPtr driver, ...@@ -3326,6 +3328,8 @@ static int doPeer2PeerMigrate3(virQEMUDriverPtr driver,
virErrorPtr orig_err = NULL; virErrorPtr orig_err = NULL;
bool cancelled; bool cancelled;
virStreamPtr st = NULL; virStreamPtr st = NULL;
unsigned int destflags = flags & ~VIR_MIGRATE_ABORT_ON_ERROR;
VIR_DEBUG("driver=%p, sconn=%p, dconn=%p, vm=%p, xmlin=%s, " VIR_DEBUG("driver=%p, sconn=%p, dconn=%p, vm=%p, xmlin=%s, "
"dconnuri=%s, uri=%s, flags=%lx, dname=%s, resource=%lu", "dconnuri=%s, uri=%s, flags=%lx, dname=%s, resource=%lu",
driver, sconn, dconn, vm, NULLSTR(xmlin), driver, sconn, dconn, vm, NULLSTR(xmlin),
...@@ -3358,13 +3362,13 @@ static int doPeer2PeerMigrate3(virQEMUDriverPtr driver, ...@@ -3358,13 +3362,13 @@ static int doPeer2PeerMigrate3(virQEMUDriverPtr driver,
ret = dconn->driver->domainMigratePrepareTunnel3 ret = dconn->driver->domainMigratePrepareTunnel3
(dconn, st, cookiein, cookieinlen, (dconn, st, cookiein, cookieinlen,
&cookieout, &cookieoutlen, &cookieout, &cookieoutlen,
flags, dname, resource, dom_xml); destflags, dname, resource, dom_xml);
qemuDomainObjExitRemote(vm); qemuDomainObjExitRemote(vm);
} else { } else {
qemuDomainObjEnterRemote(vm); qemuDomainObjEnterRemote(vm);
ret = dconn->driver->domainMigratePrepare3 ret = dconn->driver->domainMigratePrepare3
(dconn, cookiein, cookieinlen, &cookieout, &cookieoutlen, (dconn, cookiein, cookieinlen, &cookieout, &cookieoutlen,
uri, &uri_out, flags, dname, resource, dom_xml); uri, &uri_out, destflags, dname, resource, dom_xml);
qemuDomainObjExitRemote(vm); qemuDomainObjExitRemote(vm);
} }
VIR_FREE(dom_xml); VIR_FREE(dom_xml);
...@@ -3440,7 +3444,7 @@ finish: ...@@ -3440,7 +3444,7 @@ finish:
qemuDomainObjEnterRemote(vm); qemuDomainObjEnterRemote(vm);
ddomain = dconn->driver->domainMigrateFinish3 ddomain = dconn->driver->domainMigrateFinish3
(dconn, dname, cookiein, cookieinlen, &cookieout, &cookieoutlen, (dconn, dname, cookiein, cookieinlen, &cookieout, &cookieoutlen,
dconnuri, uri_out ? uri_out : uri, flags, cancelled); dconnuri, uri_out ? uri_out : uri, destflags, cancelled);
qemuDomainObjExitRemote(vm); qemuDomainObjExitRemote(vm);
/* If ddomain is NULL, then we were unable to start /* If ddomain is NULL, then we were unable to start
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册