提交 8d75e47e 编写于 作者: J Jiri Denemark

qemu: Do not require hostuuid in migration cookie

Having hostuuid in migration cookie is a nice bonus since it provides an
easy way of detecting migration to the same host. However, requiring it
breaks backward compatibility with older libvirt releases.
上级 9fcc5436
...@@ -576,22 +576,23 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig, ...@@ -576,22 +576,23 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
} }
if (!(tmp = virXPathString("string(./hostuuid[1])", ctxt))) { if (!(tmp = virXPathString("string(./hostuuid[1])", ctxt))) {
virReportError(VIR_ERR_INTERNAL_ERROR, VIR_WARN("Missing hostuuid element in migration data; cannot "
"%s", _("missing hostuuid element in migration data")); "detect migration to the same host");
goto error; } else {
}
if (virUUIDParse(tmp, mig->remoteHostuuid) < 0) { if (virUUIDParse(tmp, mig->remoteHostuuid) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
"%s", _("malformed hostuuid element in migration data")); _("malformed hostuuid element in migration data"));
goto error; goto error;
} }
if (memcmp(mig->remoteHostuuid, mig->localHostuuid, VIR_UUID_BUFLEN) == 0) { if (memcmp(mig->remoteHostuuid, mig->localHostuuid,
VIR_UUID_BUFLEN) == 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Attempt to migrate guest to the same host %s"), _("Attempt to migrate guest to the same host %s"),
tmp); tmp);
goto error; goto error;
} }
VIR_FREE(tmp); VIR_FREE(tmp);
}
/* Check to ensure all mandatory features from XML are also /* Check to ensure all mandatory features from XML are also
* present in 'flags' */ * present in 'flags' */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册