提交 5e31e713 编写于 作者: J Jiri Denemark

Clarify semantics of virDomainMigrate{,ToURI}2

Commit 5d784bd6 was a nice attempt to
clarify the semantics by requiring domain name from dxml to either match
original name or dname. However, setting dxml domain name to dname
doesn't really work since destination host needs to know the original
domain name to be able to use it in migration cookies. This patch
requires domain name in dxml to match the original domain name. The
change should be safe and backward compatible since migration would fail
just a bit later in the process.
上级 a5f8a01a
......@@ -5188,8 +5188,8 @@ error:
* if @dxml would cause any guest-visible changes. Pass NULL
* if no changes are needed to the XML between source and destination.
* @dxml cannot be used to rename the domain during migration (use
* @dname for that purpose). Domain name in @dxml must either match the
* original domain name or @dname if it was specified.
* @dname for that purpose). Domain name in @dxml must match the
* original domain name.
*
* Returns the new domain object if the migration was successful,
* or NULL in case of error. Note that the new domain object
......
......@@ -1046,11 +1046,9 @@ char *qemuMigrationBegin(struct qemud_driver *driver,
VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
if (STRNEQ(def->name, vm->def->name) &&
STRNEQ_NULLABLE(def->name, dname)) {
if (STRNEQ(def->name, vm->def->name)) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("target domain name doesn't match source name"
" nor destination name"));
_("target domain name doesn't match source name"));
goto cleanup;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册