mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
libvirt.c: Preserve MigratePerform failure
This commit is contained in:
parent
a9d12c2444
commit
e85065b854
@ -3135,6 +3135,7 @@ virDomainMigrateVersion2 (virDomainPtr domain,
|
|||||||
char *dom_xml = NULL;
|
char *dom_xml = NULL;
|
||||||
int cookielen = 0, ret;
|
int cookielen = 0, ret;
|
||||||
virDomainInfo info;
|
virDomainInfo info;
|
||||||
|
virErrorPtr orig_err = NULL;
|
||||||
|
|
||||||
/* Prepare the migration.
|
/* Prepare the migration.
|
||||||
*
|
*
|
||||||
@ -3190,6 +3191,10 @@ virDomainMigrateVersion2 (virDomainPtr domain,
|
|||||||
ret = domain->conn->driver->domainMigratePerform
|
ret = domain->conn->driver->domainMigratePerform
|
||||||
(domain, cookie, cookielen, uri, flags, dname, bandwidth);
|
(domain, cookie, cookielen, uri, flags, dname, bandwidth);
|
||||||
|
|
||||||
|
/* Perform failed. Make sure Finish doesn't overwrite the error */
|
||||||
|
if (ret < 0)
|
||||||
|
orig_err = virSaveLastError();
|
||||||
|
|
||||||
/* In version 2 of the migration protocol, we pass the
|
/* In version 2 of the migration protocol, we pass the
|
||||||
* status code from the sender to the destination host,
|
* status code from the sender to the destination host,
|
||||||
* so it can do any cleanup if the migration failed.
|
* so it can do any cleanup if the migration failed.
|
||||||
@ -3199,6 +3204,10 @@ virDomainMigrateVersion2 (virDomainPtr domain,
|
|||||||
(dconn, dname, cookie, cookielen, uri, flags, ret);
|
(dconn, dname, cookie, cookielen, uri, flags, ret);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
if (orig_err) {
|
||||||
|
virSetError(orig_err);
|
||||||
|
virFreeError(orig_err);
|
||||||
|
}
|
||||||
VIR_FREE (uri_out);
|
VIR_FREE (uri_out);
|
||||||
VIR_FREE (cookie);
|
VIR_FREE (cookie);
|
||||||
return ddomain;
|
return ddomain;
|
||||||
|
Loading…
Reference in New Issue
Block a user