[libvirt] Start external programm on network-setup

Daniel P. Berrange berrange at redhat.com
Tue Jan 12 20:20:12 UTC 2010

On Tue, Jan 12, 2010 at 04:21:49PM +0100, Dominik Bruhn wrote:
> Hy,
> im using libvirt-bin on debian and configured the network of libvirt to
> be a standalone bridge. Is there a possibility to run a program after
> the bridge has successfully and completly set up by libvirtd? I would
> like to restart shorewall (a firewall) when the bridge is set up to
> activate MASQ and DNAT and other policies which I need.  I would also
> like to start my own configured dnsmasq when the interface is up (can't
> start it realier because it has to bind to the interface).
> I hope thats the right place to ask such a question, if not, please
> direct me.

I'm afraid there's no easy way to trigger events on network create or
delete directly via libvirt at this time. 

One possible alternative you could try is to use udev. I see udevadm
triggers events ...

KERNEL[1263327559.060277] remove   /devices/virtual/net/virbr0 (net)
UDEV  [1263327559.107126] remove   /devices/virtual/net/virbr0 (net)
KERNEL[1263327570.179500] add      /devices/virtual/net/virbr0 (net)
UDEV  [1263327570.219653] add      /devices/virtual/net/virbr0 (net)

|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

More information about the libvir-list mailing list