qemu: Replace priv with qemuCaps in qemuMigrationCookieParse

QEMU capabilities is the only thing we use from priv so we can just pass
that directly.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Jiri Denemark 2022-11-30 16:05:56 +01:00
parent 8745591457
commit 9e5b42b5eb
4 changed files with 14 additions and 13 deletions

View File

@ -3935,7 +3935,8 @@ qemuMigrationSrcConfirmPhase(virQEMUDriver *driver,
if (qemuMigrationJobStartPhase(vm, phase) < 0)
return -1;
if (!(mig = qemuMigrationCookieParse(driver, vm, vm->def, priv->origname, priv,
if (!(mig = qemuMigrationCookieParse(driver, vm, vm->def, priv->origname,
priv->qemuCaps,
cookiein, cookieinlen,
QEMU_MIGRATION_COOKIE_STATS)))
return -1;
@ -4768,7 +4769,8 @@ qemuMigrationSrcRun(virQEMUDriver *driver,
}
}
mig = qemuMigrationCookieParse(driver, vm, vm->def, priv->origname, priv,
mig = qemuMigrationCookieParse(driver, vm, vm->def, priv->origname,
priv->qemuCaps,
cookiein, cookieinlen,
cookieFlags |
QEMU_MIGRATION_COOKIE_GRAPHICS |
@ -5058,7 +5060,8 @@ qemuMigrationSrcResume(virDomainObj *vm,
VIR_DEBUG("vm=%p", vm);
mig = qemuMigrationCookieParse(driver, vm, vm->def, priv->origname, priv,
mig = qemuMigrationCookieParse(driver, vm, vm->def, priv->origname,
priv->qemuCaps,
cookiein, cookieinlen,
QEMU_MIGRATION_COOKIE_CAPS);
if (!mig)
@ -6456,7 +6459,8 @@ qemuMigrationDstFinishOffline(virQEMUDriver *driver,
qemuDomainObjPrivate *priv = vm->privateData;
g_autoptr(qemuMigrationCookie) mig = NULL;
if (!(mig = qemuMigrationCookieParse(driver, vm, vm->def, priv->origname, priv,
if (!(mig = qemuMigrationCookieParse(driver, vm, vm->def, priv->origname,
priv->qemuCaps,
cookiein, cookieinlen, cookie_flags)))
return NULL;
@ -6652,7 +6656,8 @@ qemuMigrationDstFinishActive(virQEMUDriver *driver,
VIR_DEBUG("vm=%p, flags=0x%lx, retcode=%d",
vm, flags, retcode);
if (!(mig = qemuMigrationCookieParse(driver, vm, vm->def, priv->origname, priv,
if (!(mig = qemuMigrationCookieParse(driver, vm, vm->def, priv->origname,
priv->qemuCaps,
cookiein, cookieinlen, cookie_flags)))
goto error;

View File

@ -1493,7 +1493,7 @@ qemuMigrationCookieParse(virQEMUDriver *driver,
virDomainObj *vm,
const virDomainDef *def,
const char *origname,
qemuDomainObjPrivate *priv,
virQEMUCaps *qemuCaps,
const char *cookiein,
int cookieinlen,
unsigned int flags)
@ -1514,11 +1514,7 @@ qemuMigrationCookieParse(virQEMUDriver *driver,
return NULL;
if (cookiein && cookieinlen &&
qemuMigrationCookieXMLParseStr(mig,
driver,
priv ? priv->qemuCaps : NULL,
cookiein,
flags) < 0)
qemuMigrationCookieXMLParseStr(mig, driver, qemuCaps, cookiein, flags) < 0)
return NULL;
if (flags & QEMU_MIGRATION_COOKIE_PERSISTENT &&

View File

@ -192,7 +192,7 @@ qemuMigrationCookieParse(virQEMUDriver *driver,
virDomainObj *vm,
const virDomainDef *def,
const char *origname,
qemuDomainObjPrivate *priv,
virQEMUCaps *qemuCaps,
const char *cookiein,
int cookieinlen,
unsigned int flags);

View File

@ -144,7 +144,7 @@ testQemuMigrationCookieParse(const void *opaque)
data->vm,
data->vm->def,
NULL,
priv,
priv->qemuCaps,
data->xmlstr,
data->xmlstrlen,
data->cookieParseFlags))) {