]> git.ipfire.org Git - thirdparty/libvirt.git/commit
snapshot: cache qemu-img location
authorEric Blake <eblake@redhat.com>
Fri, 12 Aug 2011 16:12:47 +0000 (10:12 -0600)
committerEric Blake <eblake@redhat.com>
Sat, 3 Sep 2011 03:57:33 +0000 (21:57 -0600)
commit3881a470881b9bf48e92752236e2d28070e7c730
treefbbf3e780c28bd3ceeeeb27c4d7ebab2bee5494f
parent8055e5af82d2a3b66b3723482f2fdfad28ba942d
snapshot: cache qemu-img location

As more clients start to want to know this information, doing
a PATH stat walk and malloc for every client adds up.

We are only caching the location, not the capabilities, so even
if qemu-img is updated in the meantime, it will still probably
live in the same location.  So there is no need to worry about
clearing this particular cache.

* src/qemu/qemu_conf.h (qemud_driver): Add member.
* src/qemu/qemu_driver.c (qemudShutdown): Cleanup.
(qemuFindQemuImgBinary): Add an argument, and cache result.
(qemuDomainSnapshotForEachQcow2, qemuDomainSnapshotDiscard)
(qemuDomainSnapshotCreateInactive, qemuDomainSnapshotRevertInactive)
(qemuDomainSnapshotCreateXML, qemuDomainRevertToSnapshot): Update
callers.
src/qemu/qemu_conf.h
src/qemu/qemu_driver.c