On Mon, Aug 07, 2006 at 10:40:11PM +0100, Daniel P. Berrange wrote:
> > 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 ?
Yeah sounds resonable to me. I'll take a crack at implementing these two
additions to the XML doc and post a patch for review when I have something
reasonable working.
See attached patch which looks up port number in xenstore & also pulls
out the serial console tty. The example XML from a HVM domain now looks
like:
<domain type='xen' id='7'>
<name>twit</name>
<uuid>12cf7ed6915818803eaa98ad00bd3fc5</uuid>
<os>
<type>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='/dev/cdrom'/>
</os>
<memory>512000</memory>
<vcpu>1</vcpu>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
<interface type='bridge'>
<source bridge='xenbr0'/>
<mac address='00:16:3e:52:b2:82'/>
<script path='vif-bridge'/>
</interface>
<disk type='file'>
<source file='/root/rhel3.img'/>
<target dev='ioemu:hda'/>
</disk>
<graphics type='vnc' port='5934'/>
<console tty='/dev/pts/7'/>
</devices>
</domain>
The '<console>' element is actually available for both HVM and PV
domains. I also updated format.html with details of these XML
elements / attributes.
NB, the version of xenstore I'm running doesn't actually include
the changeset 155385a02d0b which writes the vnc-port. Thus to test
it I manually wrote an entry in the same location.
xenstore-write /local/domain/7/console/vnc-port 5934
Regards,
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules:
http://search.cpan.org/~danberr/ -=|
|=- Projects:
http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|