[Libvirt-cim] [PATCH 0 of 2] [RFC] ComputerSystemModifiedIndication
Jay Gagnon
grendel at linux.vnet.ibm.com
Thu Jan 10 16:34:36 UTC 2008
This is still pretty rough around the edges but it seems functional enough that it's worth showing, and I've got a few spots where I could use some input. Right now it does in fact notice a domain that changes and fires an indication. The "previous instance" embedded object has it's Name and UUID fields filled in; I couldn't find any other fields that seemed terribly relevant to fill in.
The places where I could use some advice:
In _lifecycle_indication, the get_typed_instance args are mostly hardcoded. This seems rather bad, but I'm not quite sure where I should get them. It's not like I have a reference being passed in to pull that out of.
The entire sys_name_from_xml feels like an abomination, but sscanf falls short and full xml parsing seems way overkill. Any suggestions on how to make it safer/more sane are welcome.
In async_ind, I once again use some hardcoded values because I'm not sure where to get them.
In lifecycle_thread, I use lv_connect because I don't think I have the requisite info for the preferred method, but AFAIK lv_connect usage is frowned upon now. I also am not sure what to do here when I get errors. Should I terminate the event loop? Where would I even return an error message to the client?
More information about the Libvirt-cim
mailing list