[libvirt] Add <console> support

Daniel P. Berrange berrange at redhat.com
Mon Dec 5 16:21:23 UTC 2011


On Mon, Dec 05, 2011 at 05:13:54PM +0100, Christophe Fergeau wrote:
> 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.

Yes, that is correct. The UDP config has an address for the local
peer, and an address for the remote peer, which should both be
dealt with in the same GVirConfigChardevSource object instance.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list