mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemu: Add virConnectPtr back to some migration methods
This partially reverts 82592551cb8c4112cfa2264d50b8dce5349533d5. When migrating a domain, qemuMigrationDstPrepareAny() is called which eventually calls qemuProcessLaunch(conn = NULL, flags = VIR_QEMU_PROCESS_START_AUTODESTROY); But the very first thing that qemuProcessLaunch does is check if AUTODESTROY flag is set and @conn is not NULL. Well, it is. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
61b49e387a
commit
9ea69808f5
@ -12138,7 +12138,7 @@ qemuDomainMigratePrepareTunnel(virConnectPtr dconn,
|
|||||||
if (virDomainMigratePrepareTunnelEnsureACL(dconn, def) < 0)
|
if (virDomainMigratePrepareTunnelEnsureACL(dconn, def) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = qemuMigrationDstPrepareTunnel(driver,
|
ret = qemuMigrationDstPrepareTunnel(driver, dconn,
|
||||||
NULL, 0, NULL, NULL, /* No cookies in v2 */
|
NULL, 0, NULL, NULL, /* No cookies in v2 */
|
||||||
st, &def, origname, flags);
|
st, &def, origname, flags);
|
||||||
|
|
||||||
@ -12201,7 +12201,7 @@ qemuDomainMigratePrepare2(virConnectPtr dconn,
|
|||||||
* length was not sufficiently large, causing failures
|
* length was not sufficiently large, causing failures
|
||||||
* migrating between old & new libvirtd
|
* migrating between old & new libvirtd
|
||||||
*/
|
*/
|
||||||
ret = qemuMigrationDstPrepareDirect(driver,
|
ret = qemuMigrationDstPrepareDirect(driver, dconn,
|
||||||
NULL, 0, NULL, NULL, /* No cookies */
|
NULL, 0, NULL, NULL, /* No cookies */
|
||||||
uri_in, uri_out,
|
uri_in, uri_out,
|
||||||
&def, origname, NULL, 0, NULL, 0,
|
&def, origname, NULL, 0, NULL, 0,
|
||||||
@ -12439,7 +12439,7 @@ qemuDomainMigratePrepare3(virConnectPtr dconn,
|
|||||||
if (virDomainMigratePrepare3EnsureACL(dconn, def) < 0)
|
if (virDomainMigratePrepare3EnsureACL(dconn, def) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = qemuMigrationDstPrepareDirect(driver,
|
ret = qemuMigrationDstPrepareDirect(driver, dconn,
|
||||||
cookiein, cookieinlen,
|
cookiein, cookieinlen,
|
||||||
cookieout, cookieoutlen,
|
cookieout, cookieoutlen,
|
||||||
uri_in, uri_out,
|
uri_in, uri_out,
|
||||||
@ -12525,7 +12525,7 @@ qemuDomainMigratePrepare3Params(virConnectPtr dconn,
|
|||||||
if (virDomainMigratePrepare3ParamsEnsureACL(dconn, def) < 0)
|
if (virDomainMigratePrepare3ParamsEnsureACL(dconn, def) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = qemuMigrationDstPrepareDirect(driver,
|
ret = qemuMigrationDstPrepareDirect(driver, dconn,
|
||||||
cookiein, cookieinlen,
|
cookiein, cookieinlen,
|
||||||
cookieout, cookieoutlen,
|
cookieout, cookieoutlen,
|
||||||
uri_in, uri_out,
|
uri_in, uri_out,
|
||||||
@ -12574,7 +12574,7 @@ qemuDomainMigratePrepareTunnel3(virConnectPtr dconn,
|
|||||||
if (virDomainMigratePrepareTunnel3EnsureACL(dconn, def) < 0)
|
if (virDomainMigratePrepareTunnel3EnsureACL(dconn, def) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = qemuMigrationDstPrepareTunnel(driver,
|
ret = qemuMigrationDstPrepareTunnel(driver, dconn,
|
||||||
cookiein, cookieinlen,
|
cookiein, cookieinlen,
|
||||||
cookieout, cookieoutlen,
|
cookieout, cookieoutlen,
|
||||||
st, &def, origname, flags);
|
st, &def, origname, flags);
|
||||||
@ -12627,7 +12627,7 @@ qemuDomainMigratePrepareTunnel3Params(virConnectPtr dconn,
|
|||||||
if (virDomainMigratePrepareTunnel3ParamsEnsureACL(dconn, def) < 0)
|
if (virDomainMigratePrepareTunnel3ParamsEnsureACL(dconn, def) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = qemuMigrationDstPrepareTunnel(driver,
|
ret = qemuMigrationDstPrepareTunnel(driver, dconn,
|
||||||
cookiein, cookieinlen,
|
cookiein, cookieinlen,
|
||||||
cookieout, cookieoutlen,
|
cookieout, cookieoutlen,
|
||||||
st, &def, origname, flags);
|
st, &def, origname, flags);
|
||||||
|
@ -2600,6 +2600,7 @@ qemuMigrationParamsResetTLS(virQEMUDriverPtr driver,
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
qemuMigrationDstPrepareAny(virQEMUDriverPtr driver,
|
qemuMigrationDstPrepareAny(virQEMUDriverPtr driver,
|
||||||
|
virConnectPtr dconn,
|
||||||
const char *cookiein,
|
const char *cookiein,
|
||||||
int cookieinlen,
|
int cookieinlen,
|
||||||
char **cookieout,
|
char **cookieout,
|
||||||
@ -2809,7 +2810,7 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver,
|
|||||||
if (qemuProcessPrepareHost(driver, vm, startFlags) < 0)
|
if (qemuProcessPrepareHost(driver, vm, startFlags) < 0)
|
||||||
goto stopjob;
|
goto stopjob;
|
||||||
|
|
||||||
rv = qemuProcessLaunch(NULL, driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN,
|
rv = qemuProcessLaunch(dconn, driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN,
|
||||||
incoming, NULL,
|
incoming, NULL,
|
||||||
VIR_NETDEV_VPORT_PROFILE_OP_MIGRATE_IN_START,
|
VIR_NETDEV_VPORT_PROFILE_OP_MIGRATE_IN_START,
|
||||||
startFlags);
|
startFlags);
|
||||||
@ -2993,6 +2994,7 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver,
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
qemuMigrationDstPrepareTunnel(virQEMUDriverPtr driver,
|
qemuMigrationDstPrepareTunnel(virQEMUDriverPtr driver,
|
||||||
|
virConnectPtr dconn,
|
||||||
const char *cookiein,
|
const char *cookiein,
|
||||||
int cookieinlen,
|
int cookieinlen,
|
||||||
char **cookieout,
|
char **cookieout,
|
||||||
@ -3005,10 +3007,10 @@ qemuMigrationDstPrepareTunnel(virQEMUDriverPtr driver,
|
|||||||
qemuMigrationCompressionPtr compression = NULL;
|
qemuMigrationCompressionPtr compression = NULL;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
VIR_DEBUG("driver=%p, cookiein=%s, cookieinlen=%d, "
|
VIR_DEBUG("driver=%p, dconn=%p, cookiein=%s, cookieinlen=%d, "
|
||||||
"cookieout=%p, cookieoutlen=%p, st=%p, def=%p, "
|
"cookieout=%p, cookieoutlen=%p, st=%p, def=%p, "
|
||||||
"origname=%s, flags=0x%lx",
|
"origname=%s, flags=0x%lx",
|
||||||
driver, NULLSTR(cookiein), cookieinlen,
|
driver, dconn, NULLSTR(cookiein), cookieinlen,
|
||||||
cookieout, cookieoutlen, st, *def, origname, flags);
|
cookieout, cookieoutlen, st, *def, origname, flags);
|
||||||
|
|
||||||
if (st == NULL) {
|
if (st == NULL) {
|
||||||
@ -3020,7 +3022,7 @@ qemuMigrationDstPrepareTunnel(virQEMUDriverPtr driver,
|
|||||||
if (!(compression = qemuMigrationAnyCompressionParse(NULL, 0, flags)))
|
if (!(compression = qemuMigrationAnyCompressionParse(NULL, 0, flags)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
ret = qemuMigrationDstPrepareAny(driver, cookiein, cookieinlen,
|
ret = qemuMigrationDstPrepareAny(driver, dconn, cookiein, cookieinlen,
|
||||||
cookieout, cookieoutlen, def, origname,
|
cookieout, cookieoutlen, def, origname,
|
||||||
st, NULL, 0, false, NULL, 0, NULL, 0,
|
st, NULL, 0, false, NULL, 0, NULL, 0,
|
||||||
compression, flags);
|
compression, flags);
|
||||||
@ -3054,6 +3056,7 @@ qemuMigrationAnyParseURI(const char *uri, bool *wellFormed)
|
|||||||
|
|
||||||
int
|
int
|
||||||
qemuMigrationDstPrepareDirect(virQEMUDriverPtr driver,
|
qemuMigrationDstPrepareDirect(virQEMUDriverPtr driver,
|
||||||
|
virConnectPtr dconn,
|
||||||
const char *cookiein,
|
const char *cookiein,
|
||||||
int cookieinlen,
|
int cookieinlen,
|
||||||
char **cookieout,
|
char **cookieout,
|
||||||
@ -3077,11 +3080,11 @@ qemuMigrationDstPrepareDirect(virQEMUDriverPtr driver,
|
|||||||
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
||||||
const char *migrateHost = cfg->migrateHost;
|
const char *migrateHost = cfg->migrateHost;
|
||||||
|
|
||||||
VIR_DEBUG("driver=%p, cookiein=%s, cookieinlen=%d, "
|
VIR_DEBUG("driver=%p, dconn=%p, cookiein=%s, cookieinlen=%d, "
|
||||||
"cookieout=%p, cookieoutlen=%p, uri_in=%s, uri_out=%p, "
|
"cookieout=%p, cookieoutlen=%p, uri_in=%s, uri_out=%p, "
|
||||||
"def=%p, origname=%s, listenAddress=%s, "
|
"def=%p, origname=%s, listenAddress=%s, "
|
||||||
"nmigrate_disks=%zu, migrate_disks=%p, nbdPort=%d, flags=0x%lx",
|
"nmigrate_disks=%zu, migrate_disks=%p, nbdPort=%d, flags=0x%lx",
|
||||||
driver, NULLSTR(cookiein), cookieinlen,
|
driver, dconn, NULLSTR(cookiein), cookieinlen,
|
||||||
cookieout, cookieoutlen, NULLSTR(uri_in), uri_out,
|
cookieout, cookieoutlen, NULLSTR(uri_in), uri_out,
|
||||||
*def, origname, NULLSTR(listenAddress),
|
*def, origname, NULLSTR(listenAddress),
|
||||||
nmigrate_disks, migrate_disks, nbdPort, flags);
|
nmigrate_disks, migrate_disks, nbdPort, flags);
|
||||||
@ -3185,7 +3188,7 @@ qemuMigrationDstPrepareDirect(virQEMUDriverPtr driver,
|
|||||||
if (*uri_out)
|
if (*uri_out)
|
||||||
VIR_DEBUG("Generated uri_out=%s", *uri_out);
|
VIR_DEBUG("Generated uri_out=%s", *uri_out);
|
||||||
|
|
||||||
ret = qemuMigrationDstPrepareAny(driver, cookiein, cookieinlen,
|
ret = qemuMigrationDstPrepareAny(driver, dconn, cookiein, cookieinlen,
|
||||||
cookieout, cookieoutlen, def, origname,
|
cookieout, cookieoutlen, def, origname,
|
||||||
NULL, uri ? uri->scheme : "tcp",
|
NULL, uri ? uri->scheme : "tcp",
|
||||||
port, autoPort, listenAddress,
|
port, autoPort, listenAddress,
|
||||||
|
@ -170,6 +170,7 @@ qemuMigrationAnyPrepareDef(virQEMUDriverPtr driver,
|
|||||||
|
|
||||||
int
|
int
|
||||||
qemuMigrationDstPrepareTunnel(virQEMUDriverPtr driver,
|
qemuMigrationDstPrepareTunnel(virQEMUDriverPtr driver,
|
||||||
|
virConnectPtr dconn,
|
||||||
const char *cookiein,
|
const char *cookiein,
|
||||||
int cookieinlen,
|
int cookieinlen,
|
||||||
char **cookieout,
|
char **cookieout,
|
||||||
@ -181,6 +182,7 @@ qemuMigrationDstPrepareTunnel(virQEMUDriverPtr driver,
|
|||||||
|
|
||||||
int
|
int
|
||||||
qemuMigrationDstPrepareDirect(virQEMUDriverPtr driver,
|
qemuMigrationDstPrepareDirect(virQEMUDriverPtr driver,
|
||||||
|
virConnectPtr dconn,
|
||||||
const char *cookiein,
|
const char *cookiein,
|
||||||
int cookieinlen,
|
int cookieinlen,
|
||||||
char **cookieout,
|
char **cookieout,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user