On Fri, Nov 07, 2008 at 07:12:46AM -0500, Ben Guthro wrote:
I think this sounds reasonable.
Let me see if I understand the state machine for a newly created persistent domain:
DEFINED->ADDED->STARTED->STOPPED
Actually, swap ADDED & DEFINED, and for completeness, if I
add in an virDomainUndefine, you'd get
ADDED->DEFINED->STARTED->STOPPED->UNDEFINED->REMOVED
Starting, then stopping a previously defined persistent domain would just emit
STARTED->STOPPED
and a transient domain would be:
ADDED->STARTED->STOPPED->REMOVED
Yes, that's one possible path. If you were to define a config
for an existing transient domain though you could end up with
ADDED->STARTED->DEFINED->STOPPED->UNDEFINED->REMOVED
Will it be an issue for domains that only support a
subset of these events (like xen)
I think it is inevitable that this happens, so we likely
want some way to inform the application what events are
available for the driver.
Yesterday, I began looking into creating a xen driver patch for
emitting the DEFINED/UNDEFINED events via inotify.
It looks like the easiest way to do this right now is to create yet another Xen
sub-driver.
I don't expect this to take an extremely long time, as this tutorial from IBM makes
it fairly straightforward to understand:
http://www-128.ibm.com/developerworks/linux/library/l-inotify.html
The experimental user mode linux driver has some iNotify code in
it too if you want another point of reference. See the
umlInotifyEvent() method umlStartup() where I register for the
events
http://www.redhat.com/archives/libvir-list/2008-October/msg00355.html
Daniel
--
|: 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 :|