]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Only probe qemu for machine types when binary changes
authorMark McLoughlin <markmc@redhat.com>
Fri, 24 Jul 2009 11:34:20 +0000 (12:34 +0100)
committerMark McLoughlin <markmc@redhat.com>
Mon, 27 Jul 2009 14:30:35 +0000 (15:30 +0100)
commit707302b2cfdfeb04068dfae9862b5613ebd11a09
treed24e5e14663f905ecf3d86644fe63b76fbce7b39
parent0f15d0344d797630f2ee243043639328526d3148
Only probe qemu for machine types when binary changes

By probing for qemu machine types, we increased the time of a
GetCapabilities call from 100us to a whopping 60ms.

This patch takes the approach of only probing for machine types
when the mtime of the emulator binary changed since the last time
the capabilities were generated.

* src/capabilities.h: cache the emulator binary mtime

* src/qemu_conf.c: add qemudGetOldMachines() to copy the machine
  types from the old caps struct if the mtime for the binary hasn't
  changed

* src/qemu_conf.h, src/qemu_driver.c: pass the old caps pointer to
  qemudCapsInit()
src/capabilities.h
src/qemu_conf.c
src/qemu_conf.h
src/qemu_driver.c