File 1fbdfc53-xen-xm-gen-uuid.patch of Package libvirt.openSUSE_12.1_Update

commit 1fbdfc53be80816d25bc52fdb0524530d5c7341a
Author: Jim Fehlig <jfehlig@suse.com>
Date:   Fri Aug 3 15:10:13 2012 -0600

    xen-xm: Generate UUID if not specified
    
    Parsing xen-xm format configuration will fail if UUID is not
    specified, e.g.
    
    virsh domxml-from-native xen-xm some-config-without-uuid
    error: internal error parsing xm config failed
    
    Initially I thought to skip parsing the UUID in xenParseXM() when
    not present in the configuration, but this results in a UUID of
    all zeros since it is never set
    
    virsh domxml-from-native xen-xm /tmp/jim/bug-773621_pierre-test
    <domain type='xen'>
      <name>test</name>
      <uuid>00000000-0000-0000-0000-000000000000</uuid>
      ...
    
    which certainly can't be correct since this is the UUID the xen
    tools use for dom0.
    
    This patch takes the approach of generating a UUID when it is not
    specified in the configuration.

Index: libvirt-0.9.6/src/xenxs/xen_xm.c
===================================================================
--- libvirt-0.9.6.orig/src/xenxs/xen_xm.c
+++ libvirt-0.9.6/src/xenxs/xen_xm.c
@@ -177,7 +177,10 @@ static int xenXMConfigGetUUID(virConfPtr
     if (!uuid || !name || !conf)
         return (-1);
     if (!(val = virConfGetValue(conf, name))) {
-        return (-1);
+        if (virUUIDGenerate(uuid))
+            return (-1);
+        else
+            return (0);
     }
 
     if (val->type != VIR_CONF_STRING)
openSUSE Build Service is sponsored by