]> xenbits.xensource.com Git - libvirt.git/commit
qemu: conf: Cache domCaps in qemuCaps
authorCole Robinson <crobinso@redhat.com>
Thu, 4 Apr 2019 21:06:12 +0000 (17:06 -0400)
committerCole Robinson <crobinso@redhat.com>
Tue, 6 Aug 2019 23:45:49 +0000 (19:45 -0400)
commit270583ed98721643cad93be0b61b300028e45c37
treed245a674c6a4b10b70fd37a92e5691c5e6c9bc0f
parentd05bdff79b9bf4e6e49fbaf09cc0b776d127ac7e
qemu: conf: Cache domCaps in qemuCaps

qemuCaps is tied to a binary on disk. domCaps is tied to a combo
of binary+machine+arch+virttype values. For the qemu driver this almost
entirely translates to a permutation of qemuCaps though

Upcoming patches want to use the domCaps data store at XML validate
time, but we need to cache the data so we aren't repeatedly
regenerating it.

Add a domCapsCache hash table to qemuCaps. This ensures that the domCaps
cache is blown away whenever qemuCaps needs to be regenerated. Similarly
when qemuCaps is invalidated, the next call to virQEMUCapsCacheLookup
will unref qemuCaps and free our cache as well.

Adjust virQEMUDriverGetDomainCapabilities to search the cache and add
to it if we don't find a hit.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_capabilities.c
src/qemu/qemu_capabilities.h
src/qemu/qemu_conf.c