+Thu Apr 27 14:17:04 EDT 2006 Daniel Veillard <veillard@redhat.com>
+
+ * src/xml.c src/xend_internal.c TODO: added uuid to the XML
+ serialization
+
Wed Apr 26 08:32:38 CEST 2006 Daniel Veillard <veillard@redhat.com>
* src/xml.c: applied patch from Jeremy Katz to not require a
- DTD/RNG/XSD schemas for the XML Domain descriptions
- in python bindings raise an exception if a lookup or connection fails
to return a non-None object
-- Add uuid to XML format
- add error handling hooks at the python level
- object unicity for domains at the Python level
- UUID lookup in hash.c
- API for the Node: extracting informations
- docs for the principle in the error handling code
- thread protection, reentrancy, refcounting, etc ...
+- Add uuid to XML format
goto error;
}
virBufferVSprintf(&buf, " <name>%s</name>\n", tmp);
+ tmp = sexpr_node(root, "domain/uuid");
+ if (tmp != NULL) {
+ char compact[33];
+ int i, j;
+ for (i = 0, j = 0;(i < 32) && (tmp[j] != 0);j++) {
+ if (((tmp[j] >= '0') && (tmp[j] <= '9')) ||
+ ((tmp[j] >= 'a') && (tmp[j] <= 'f')))
+ compact[i++] = tmp[j];
+ else if ((tmp[j] >= 'A') && (tmp[j] <= 'F'))
+ compact[i++] = tmp[j] + 'a' - 'A';
+ }
+ compact[i] = 0;
+ if (i > 0)
+ virBufferVSprintf(&buf, " <uuid>%s</uuid>\n", compact);
+ }
tmp = sexpr_node(root, "domain/bootloader");
if (tmp != NULL)
virBufferVSprintf(&buf, " <bootloader>%s</bootloader>\n", tmp);
virDomainGetXMLDesc(virDomainPtr domain, int flags)
{
char *ret = NULL;
+ unsigned char uuid[16];
virBuffer buf;
virDomainInfo info;
virDomainGetID(domain));
virBufferVSprintf(&buf, " <name>%s</name>\n",
virDomainGetName(domain));
+ if (virDomainGetUUID(domain, &uuid[0]) == 0) {
+ virBufferVSprintf(&buf,
+" <uuid>%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x</uuid>\n",
+ uuid[0], uuid[1], uuid[2], uuid[3],
+ uuid[4], uuid[5], uuid[6], uuid[7],
+ uuid[8], uuid[9], uuid[10], uuid[11],
+ uuid[12], uuid[13], uuid[14], uuid[15]);
+ }
virDomainGetXMLBoot(domain, &buf);
virBufferVSprintf(&buf, " <memory>%lu</memory>\n", info.maxMem);
virBufferVSprintf(&buf, " <vcpu>%d</vcpu>\n", (int) info.nrVirtCpu);