diff --git a/docs/hooks.html.in b/docs/hooks.html.in index f0f692bc0a..07b9d49986 100644 --- a/docs/hooks.html.in +++ b/docs/hooks.html.in @@ -13,9 +13,15 @@ actions occur:

Script location

@@ -44,6 +50,9 @@ Executed when a QEMU guest is started, stopped, or migrated

  • /etc/libvirt/hooks/lxc

    Executed when an LXC guest is started or stopped
  • +
  • /etc/libvirt/hooks/network

    + Executed when a network is started or stopped or an + interface is plugged/unplugged to/from the network

  • @@ -66,6 +75,39 @@ XML description for the domain on their stdin. This includes items such the UUID of the domain and its storage information, and is intended to provide all the libvirt information the script needs.

    +

    For all cases, stdin of the network hook script is provided with the + full XML description of the network status in the following form:

    + +
    <hookData>
    +  <network>
    +     <name>$network_name</name>
    +     <uuid>afca425a-2c3a-420c-b2fb-dd7b4950d722</uuid>
    +     ...
    +  </network>
    +</hookData>
    + +

    In the case of an interface + being plugged/unplugged to/from the network, the network XML will be + followed with the full XML description of the domain containing the + interface that is being plugged/unplugged:

    + +
    <hookData>
    +  <network>
    +     <name>$network_name</name>
    +     <uuid>afca425a-2c3a-420c-b2fb-dd7b4950d722</uuid>
    +     ...
    +  </network>
    +  <domain type='$domain_type' id='$domain_id'>
    +     <name>$domain_name</name>
    +     <uuid>afca425a-2c3a-420c-b2fb-dd7b4950d722</uuid>
    +     ...
    +  </domain>
    +</hookData>
    + +

    Please note that this approach is different from other cases such as + daemon, qemu or lxc hook scripts, + because two XMLs may be passed here, while in the other cases only a single + XML is passed.

    The command line arguments take this approach:

      @@ -181,25 +223,49 @@
      /etc/libvirt/hooks/lxc guest_name reconnect begin -
      + +
      /etc/libvirt/hooks/network
      + +

      Script execution