Bug 699657 - [FEATURE REQUEST] post vm start hook
Summary: [FEATURE REQUEST] post vm start hook
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-04-26 09:46 UTC by Sander
Modified: 2015-07-28 15:22 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-07-28 15:22:02 UTC


Attachments (Terms of Use)

Description Sander 2011-04-26 09:46:47 UTC
I'm wondering if there's a specific reason for not including a hook that gets called when a vm has finished starting. I would find that very convenient to have.

For example, I want to perform some actions based on the pid of the started vm which is not really possible in a clean way at this moment. Correct me if I'm wrong though.

Comment 1 Ján Tomko 2015-07-28 15:22:02 UTC
Hooks after the vm has started have been added to the QEMU and LXC drivers by:
commit 6510c97bf5920044355d22646a91fb0a8fb9bf68
Author:     Daniel P. Berrange <berrange>
AuthorDate: 2012-05-28 15:04:31 +0100
Commit:     Daniel P. Berrange <berrange>
CommitDate: 2012-06-13 18:23:00 +0100

    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

git describe: v0.9.12-202-g6510c97 contains: v0.9.13-rc1~81


Note You need to log in before you can comment on or make changes to this bug.