On Wed, Jul 22, 2009 at 05:02:55PM +0100, Daniel P. Berrange wrote:
* src/lxc_conf.h: Add queue for dispatch of domain events
* src/lxc_driver.c: Trigger domain events upon important lifecycle transitions
[...]
@@ -293,6 +303,8 @@ static virDomainPtr lxcDomainDefine(virConnectPtr
conn, const char *xml)
virDomainDefPtr def = NULL;
virDomainObjPtr vm = NULL;
virDomainPtr dom = NULL;
+ virDomainEventPtr event = NULL;
+ int newVM = 1;
Hum I don't see where newVM is set to anything else in that patch
isn't there something missing ?
lxcDriverLock(driver);
if (!(def = virDomainDefParseString(conn, driver->caps, xml,
@@ -318,6 +330,12 @@ static virDomainPtr lxcDomainDefine(virConnectPtr conn, const char
*xml)
goto cleanup;
}
+ event = virDomainEventNewFromObj(vm,
+ VIR_DOMAIN_EVENT_DEFINED,
+ newVM ?
+ VIR_DOMAIN_EVENT_DEFINED_ADDED :
+ VIR_DOMAIN_EVENT_DEFINED_UPDATED);
+
@@ -532,6 +559,13 @@ static int lxcVMCleanup(virConnectPtr conn,
virCgroupFree(&cgroup);
}
+ if (vm->newDef) {
+ virDomainDefFree(vm->def);
+ vm->def = vm->newDef;
+ vm->def->id = -1;
+ vm->newDef = NULL;
+ }
+
Hum newDef is not touched anywhere else in that patch, unrelated ?
Except that couple of question, looks fine, ACK,
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit
http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine
http://rpmfind.net/
http://veillard.com/ | virtualization library
http://libvirt.org/