提交 dbbc9a3c 编写于 作者: P Peter Krempa

qemu: Move and rename qemuDomainUpdateQEMUCaps

The function is now used only in qemu_process.c so move it there and
name it 'qemuProcessPrepareQEMUCaps' which is more appropriate to what
it's doing.

The reworded comment now mentions that it will also post-process the
caps for VM startup.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 530d7a73
......@@ -15065,32 +15065,6 @@ qemuDomainFixupCPUs(virDomainObjPtr vm,
}
/**
* qemuDomainUpdateQEMUCaps:
* @vm: domain object
* @qemuCapsCache: cache of QEMU capabilities
*
* This function updates the used QEMU capabilities of @vm by querying
* the QEMU capabilities cache.
*
* Returns 0 on success, -1 on error.
*/
int
qemuDomainUpdateQEMUCaps(virDomainObjPtr vm,
virFileCachePtr qemuCapsCache)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
virObjectUnref(priv->qemuCaps);
if (!(priv->qemuCaps = virQEMUCapsCacheLookupCopy(qemuCapsCache,
vm->def->virtType,
vm->def->emulator,
vm->def->os.machine)))
return -1;
return 0;
}
char *
qemuDomainGetMachineName(virDomainObjPtr vm)
{
......
......@@ -1155,10 +1155,6 @@ int
qemuDomainFixupCPUs(virDomainObjPtr vm,
virCPUDefPtr *origCPU);
int
qemuDomainUpdateQEMUCaps(virDomainObjPtr vm,
virFileCachePtr qemuCapsCache);
char *
qemuDomainGetMachineName(virDomainObjPtr vm);
......
......@@ -5486,6 +5486,34 @@ qemuProcessStartUpdateCustomCaps(virDomainObjPtr vm)
}
/**
* qemuProcessPrepareQEMUCaps:
* @vm: domain object
* @qemuCapsCache: cache of QEMU capabilities
*
* Prepare the capabilities of a QEMU process for startup. This includes
* copying the caps to a static cache and potential post-processing depending
* on the configuration of the VM and startup process.
*
* Returns 0 on success, -1 on error.
*/
static int
qemuProcessPrepareQEMUCaps(virDomainObjPtr vm,
virFileCachePtr qemuCapsCache)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
virObjectUnref(priv->qemuCaps);
if (!(priv->qemuCaps = virQEMUCapsCacheLookupCopy(qemuCapsCache,
vm->def->virtType,
vm->def->emulator,
vm->def->os.machine)))
return -1;
return 0;
}
/**
* qemuProcessInit:
*
......@@ -5537,7 +5565,7 @@ qemuProcessInit(virQEMUDriverPtr driver,
}
VIR_DEBUG("Determining emulator version");
if (qemuDomainUpdateQEMUCaps(vm, driver->qemuCapsCache) < 0)
if (qemuProcessPrepareQEMUCaps(vm, driver->qemuCapsCache) < 0)
goto cleanup;
if (flags & VIR_QEMU_PROCESS_START_STANDALONE)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册