[Libvir] Add port number to <graphics> tag
veillard at redhat.com
Mon Aug 7 21:35:18 UTC 2006
On Mon, Aug 07, 2006 at 10:12:02PM +0100, Daniel P. Berrange wrote:
> On Mon, Aug 07, 2006 at 12:11:17PM -0400, Daniel Veillard wrote:
> > On Mon, Aug 07, 2006 at 11:55:00AM -0400, Jeremy Katz wrote:
> > > It should be in xenstore now... I saw the patch float by the end of
> > > last week. But we'll probably still want to fall back to this for
> > > versions of xend that didn't do so.
> > >
> > > Jeremy
> > >
> > >  Looks like under domainpath/console/vnc-port, commit is
> > > http://xenbits.xensource.com/xen-unstable.hg?cs=155385a02d0b
> > Ha ha :-)
> > that look way saner to me, except nobody but root can really get the
> > information (IIRC by default the xenstore _ro socket is not accessible).
> This actually raises an interesting question. The current code for constructing
> the XML for a domain is done in the XenD backend - xend_internal.c Extracting
> the port, however, would require talking to XenStore. All the XenStore related
> code, however, is in a different driver backend xs_internal.c
Annoying isn't it ;-) ?
> So how should we go about implementing this ? Can we have code in xend_internal.c
> that talks to XenStore to extract the VNC port ?
yes, one must check first that the xenstore connection is open (or the
read-only one in the proxy this is a TODO it wasn't needed until now)
and do the cross call. I think there is little to gain there trying to
reach absolute purity within the
> Or should we have XML generation
> code in xs_internal.c too & somehow merge the 2 XML docs (yuk).
In 9 years of libxml I managed to resist trying to do the merge operation,
I am not gonna try now :-)
> This is the same problem we so far prevented me adding the path to the
> serial console Psuedo-TTY to the XML for a domain. I'd rather like to have
> this in 0.1.4 release of libvirt too, so any suggestions on how to approach
> implementation when some of the data for the XML needs to come from XS ?
I would make a wrapper function for the 2 special xs_read calls, to only
export relatively high level interface from xs_internal.h for example
int xenStoreDomainVncPort(virDomainPtr domain);
returning -1 in case of error. Similar for the TTY.
Make sense ?
Daniel Veillard | Red Hat http://redhat.com/
veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
More information about the libvir-list