
On Mon, Dec 05, 2011 at 01:35:52PM +0000, Daniel P. Berrange wrote:
On Fri, Dec 02, 2011 at 02:40:03PM +0100, Christophe Fergeau wrote:
Hi,
This patch series adds support for setting <console> nodes as has been discussed in the "[PATCH libvirt-glib 02/15] Add objects for dealing with <console> devices" thread.
It introduces a GVirConfigDomainChardev which derives from GVirConfigDomainDevice. The actual classes to create <console>, <serial>, <parallel> nodes will inherit from this parent class.
Then we have GVirConfigDomainChardevSource which derives from GVirConfigObject (with a dummy root node name) and from which derives GVirConfigDomainChardevSourcePty.
A GVirConfigDomainChardevSourcePty is associated to a GVirConfigDomainConsole object through GVirConfigDomainChardev::add_source. Maybe it should be ::set_source, I'm unsure... The code from ::add_source directly messes with the xml nodes so a careful review won't hurt :)
At this point I consider this to be at least 50% RFC so we can still redesign the whole thing.
I think it looks ok to me, if we use 'set_source' as you suggest, since there is only one which can be associated at a time.
Ok, there can be several source nodes for UDP if I understand http://libvirt.org/formatdomain.html#elementsCharUDP correctly, but with the approach I took, they can all be wrapped in a single GVirConfigChardevSource object. I'll rename the method and resend the series then. Christophe