mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 20:45:18 +00:00
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.
This commit is contained in:
parent
9fcc5436d3
commit
8d75e47ede
@ -576,22 +576,23 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
|
||||
}
|
||||
|
||||
if (!(tmp = virXPathString("string(./hostuuid[1])", ctxt))) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("missing hostuuid element in migration data"));
|
||||
goto error;
|
||||
VIR_WARN("Missing hostuuid element in migration data; cannot "
|
||||
"detect migration to the same host");
|
||||
} else {
|
||||
if (virUUIDParse(tmp, mig->remoteHostuuid) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("malformed hostuuid element in migration data"));
|
||||
goto error;
|
||||
}
|
||||
if (memcmp(mig->remoteHostuuid, mig->localHostuuid,
|
||||
VIR_UUID_BUFLEN) == 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Attempt to migrate guest to the same host %s"),
|
||||
tmp);
|
||||
goto error;
|
||||
}
|
||||
VIR_FREE(tmp);
|
||||
}
|
||||
if (virUUIDParse(tmp, mig->remoteHostuuid) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("malformed hostuuid element in migration data"));
|
||||
goto error;
|
||||
}
|
||||
if (memcmp(mig->remoteHostuuid, mig->localHostuuid, VIR_UUID_BUFLEN) == 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Attempt to migrate guest to the same host %s"),
|
||||
tmp);
|
||||
goto error;
|
||||
}
|
||||
VIR_FREE(tmp);
|
||||
|
||||
/* Check to ensure all mandatory features from XML are also
|
||||
* present in 'flags' */
|
||||
|
Loading…
x
Reference in New Issue
Block a user