• C
    qemu: conf: Cache domCaps in qemuCaps · 270583ed
    Cole Robinson 提交于
    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: NCole Robinson <crobinso@redhat.com>
    Reviewed-by: NReviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
    Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
    270583ed
qemu_capabilities.h 29.7 KB