mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
Fix QEMU p2p v2 migration when run from a v3 client
When peer-2-peer migration was invoked by a client supporting v3, but where the target server only supported v2, we'd not correctly shutdown the guest. * src/qemu/qemu_migration.c: Ensure guest is shutdown in v2 peer 2 peer migration
This commit is contained in:
parent
cc79a4c52e
commit
3e87a3901a
@ -2199,12 +2199,12 @@ static int doPeer2PeerMigrate(struct qemud_driver *driver,
|
|||||||
const char *uri,
|
const char *uri,
|
||||||
unsigned long flags,
|
unsigned long flags,
|
||||||
const char *dname,
|
const char *dname,
|
||||||
unsigned long resource)
|
unsigned long resource,
|
||||||
|
bool *v3proto)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
virConnectPtr dconn = NULL;
|
virConnectPtr dconn = NULL;
|
||||||
bool p2p;
|
bool p2p;
|
||||||
bool v3;
|
|
||||||
VIR_DEBUG("driver=%p, sconn=%p, vm=%p, xmlin=%s, dconnuri=%s, "
|
VIR_DEBUG("driver=%p, sconn=%p, vm=%p, xmlin=%s, dconnuri=%s, "
|
||||||
"uri=%s, flags=%lu, dname=%s, resource=%lu",
|
"uri=%s, flags=%lu, dname=%s, resource=%lu",
|
||||||
driver, sconn, vm, NULLSTR(xmlin), NULLSTR(dconnuri),
|
driver, sconn, vm, NULLSTR(xmlin), NULLSTR(dconnuri),
|
||||||
@ -2226,8 +2226,12 @@ static int doPeer2PeerMigrate(struct qemud_driver *driver,
|
|||||||
qemuDomainObjEnterRemoteWithDriver(driver, vm);
|
qemuDomainObjEnterRemoteWithDriver(driver, vm);
|
||||||
p2p = VIR_DRV_SUPPORTS_FEATURE(dconn->driver, dconn,
|
p2p = VIR_DRV_SUPPORTS_FEATURE(dconn->driver, dconn,
|
||||||
VIR_DRV_FEATURE_MIGRATION_P2P);
|
VIR_DRV_FEATURE_MIGRATION_P2P);
|
||||||
v3 = VIR_DRV_SUPPORTS_FEATURE(dconn->driver, dconn,
|
/* v3proto reflects whether the caller used Perform3, but with
|
||||||
VIR_DRV_FEATURE_MIGRATION_V3);
|
* p2p migrate, regardless of whether Perform3 or Perform3
|
||||||
|
* were used, we decide protocol based on what target supports
|
||||||
|
*/
|
||||||
|
*v3proto = VIR_DRV_SUPPORTS_FEATURE(dconn->driver, dconn,
|
||||||
|
VIR_DRV_FEATURE_MIGRATION_V3);
|
||||||
qemuDomainObjExitRemoteWithDriver(driver, vm);
|
qemuDomainObjExitRemoteWithDriver(driver, vm);
|
||||||
|
|
||||||
if (!p2p) {
|
if (!p2p) {
|
||||||
@ -2243,7 +2247,7 @@ static int doPeer2PeerMigrate(struct qemud_driver *driver,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (v3)
|
if (*v3proto)
|
||||||
ret = doPeer2PeerMigrate3(driver, sconn, dconn, vm, xmlin,
|
ret = doPeer2PeerMigrate3(driver, sconn, dconn, vm, xmlin,
|
||||||
dconnuri, uri, flags, dname, resource);
|
dconnuri, uri, flags, dname, resource);
|
||||||
else
|
else
|
||||||
@ -2310,7 +2314,8 @@ int qemuMigrationPerform(struct qemud_driver *driver,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (doPeer2PeerMigrate(driver, conn, vm, xmlin,
|
if (doPeer2PeerMigrate(driver, conn, vm, xmlin,
|
||||||
dconnuri, uri, flags, dname, resource) < 0)
|
dconnuri, uri, flags, dname,
|
||||||
|
resource, &v3proto) < 0)
|
||||||
/* doPeer2PeerMigrate already set the error, so just get out */
|
/* doPeer2PeerMigrate already set the error, so just get out */
|
||||||
goto endjob;
|
goto endjob;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user