]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Add some missing hook functions
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 28 May 2012 14:04:31 +0000 (15:04 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 13 Jun 2012 17:23:00 +0000 (18:23 +0100)
commit6510c97bf5920044355d22646a91fb0a8fb9bf68
treeff1007777493666ac3190ebebe515324644cc2de
parent5d490603a6d60298162cbd32ec45f736b58929fb
Add some missing hook functions

A core use case of the hook scripts is to be able to do things
to a guest's network configuration. It is possible to hook into
the 'start' operation for a QEMU guest which runs just before
the guest is started. The TAP devices will exist at this point,
but the QEMU process will not. It can be desirable to have a
'started' hook too, which runs once QEMU has started.

If libvirtd is restarted it will re-populate firewall rules,
but there is no QEMU hook to trigger for existing domains.
This is solved with a 'reconnect' hook.

Finally, if attaching to an external QEMU process there needs
to be an 'attach' hook script.

This all also applies to the LXC driver

* docs/hooks.html.in: Document new operations
* src/util/hooks.c, src/util/hooks.c: Add 'started', 'reconnect'
  and 'attach' operations for QEMU. Add 'prepare', 'started',
  'release' and 'reconnect' operations for LXC
* src/lxc/lxc_driver.c: Add hooks for 'prepare', 'started',
  'release' and 'reconnect' operations
* src/qemu/qemu_process.c: Add hooks for 'started', 'reconnect'
  and 'reconnect' operations
docs/hooks.html.in
src/lxc/lxc_driver.c
src/qemu/qemu_process.c
src/util/hooks.c
src/util/hooks.h