
On Wed, Apr 09, 2008 at 12:52:33PM +0100, Richard W.M. Jones wrote:
On Tue, Apr 08, 2008 at 10:49:01AM -0700, Ryan Scott wrote:
@@ -1794,11 +1802,17 @@ virDomainGetUUID(virDomainPtr domain, un return (-1); }
+#ifndef WITH_LDOMS if (domain->id == 0) { memset(uuid, 0, VIR_UUID_BUFLEN); } else { memcpy(uuid, &domain->uuid[0], VIR_UUID_BUFLEN); } +#endif + +#ifdef WITH_LDOMS + memcpy(uuid, &domain->uuid[0], VIR_UUID_BUFLEN); +#endif return (0); }
I guess this is working around the Xen assumption that dom0 has UUID 0000-0000-0000-0000, so it exposes a Xen-ism in the code. This should move down to the Xen driver, so I'll propose a patch to fix that, which should remove the need for the specific #ifdef here.
Yeah, I recall discussing this before. IIRC, we determined that the domain object will alwayss have a valid UUID, therefore the explicit memset(uuid, 0, VIR_UUID_BUFLEN); is legacy code & redundant.
@@ -5025,6 +5039,42 @@ virStorageVolGetPath(virStorageVolPtr vo return NULL; }
+#ifdef WITH_LDOMS +/** + * virLDomConsole: + * @domain: the domain if available [...]
I think having a generic "get console" call in libvirt might be a good idea, but having public LDom-specific calls isn't. Dan Berrange will correct me if I'm wrong here, but currently the method used is to dump the domain XML of a domain and look for the <console/> or <graphics/> element within <devices/>, corresponding to the serial console or the graphical (VNC) console respectively.
For example it might look like:
<graphics type='vnc' port='5904'/>
(see full example at http://libvirt.org/format.html). So can you add a similar device to the LDom domain XML to avoid the need for this new call?
From reading the virsh code it looks like virLDomConsole is meant to return the telnet port number for the serial console(?) so perhaps something like:
<console port='1234'/>
The <console> tag only allows for PTYs currently, but I'm parttime hacking on this more general proposal too http://www.redhat.com/archives/libvir-list/2007-May/msg00191.html which allows for TCP access to console, so I think we can come up with something which works for LDoms too. Dan. -- |: Red Hat, Engineering, Boston -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|