For a domain definition there are numerous calls of
virQEMUCapsCacheLookup (the same applies to the domain start). This
slows down the process since virQEMUCapsCacheLookup validates that the
QEMU capabilitites are still valid (among other things, a fork is done
for this if the user for the QEMU processes is 'qemu'). Therefore
let's reduce the number of virQEMUCapsCacheLookup calls whenever
possible and reasonable.
In addition to the speed up, there is the risk that
virQEMUCapsCacheLookup returns different QEMU capabilities during a
task if, for example, the QEMU binary has changed during the task.
The correct way would be:
- get the QEMU capabilities only once per task via virQEMUCapsCacheLookup
- do the task with these QEMU capabilities
or
- abort the task after a cache invalidation
Note: With this patch series the behavior is still not (completely)
fixed, but the performance has been significantly improved. In a quick
test this gave a speed up of factor 4 for a simple define/undefine
loop.
In general, the more devices a domain has, the more drastic the
overhead becomes (because a cache validation is performed for each
device).
Marc Hartmayer (11):
qemu: Use VIR_STEAL_PTR macro
qemu: Introduce qemuDomainUpdateQEMUCaps()
qemu: Pass QEMUCaps to virDomainDefPostParse
conf: Use getParseOpaque() in virDomainObjSetDefTransient
conf: Add function description for virDomainDefPostParse
conf: Get rid of virDomainDeviceDefPostParseOne
conf: Extend virDomainDefValidate(Callback) for parseOpaque
conf: Use domainPostParseData(Alloc|Free) in virDomainDefValidate
qemu: Use @parseOpaque in qemuDomainDefValidate
conf: Extend virDomainDeviceDefValidate(Callback) for parseOpaque
qemu: Use @parseOpaque in qemuDomainDeviceDefValidate
src/conf/domain_conf.c | 98 ++++++++++++++++++++++++++---------------
src/conf/domain_conf.h | 9 ++--
src/qemu/qemu_domain.c | 82 +++++++++++++++++++---------------
src/qemu/qemu_domain.h | 4 ++
src/qemu/qemu_process.c | 18 +++-----
src/vz/vz_driver.c | 6 ++-
6 files changed, 128 insertions(+), 89 deletions(-)
--
2.17.0