File gdev-listen.patch of Package libvirt-cim

Index: libvirt-cim-0.5.2/libxkutil/device_parsing.c
===================================================================
--- libvirt-cim-0.5.2.orig/libxkutil/device_parsing.c
+++ libvirt-cim-0.5.2/libxkutil/device_parsing.c
@@ -434,9 +434,6 @@ static int parse_graphics_device(xmlNode
         if ((gdev->type == NULL) || (gdev->port == NULL))
                 goto err;
 
-        if (gdev->host == NULL)
-                gdev->host = strdup("127.0.0.1");
-
         vdev->type = CIM_RES_TYPE_GRAPHICS;
 
         *vdevs = vdev;
Index: libvirt-cim-0.5.2/libxkutil/xmlgen.c
===================================================================
--- libvirt-cim-0.5.2.orig/libxkutil/xmlgen.c
+++ libvirt-cim-0.5.2/libxkutil/xmlgen.c
@@ -368,13 +368,26 @@ static bool graphics_to_xml(char **xml, 
         char *_xml;
         struct graphics_device *graphics = &dev->dev.graphics;
 
-        ret = asprintf(&_xml,
-                       "<graphics type='%s' port='%s' "
-                       "listen='%s' keymap='%s'/>\n",
-                       graphics->type,
-                       graphics->port,
-                       graphics->host != NULL ? graphics->host : "127.0.0.1",
-                       graphics->keymap != NULL ? graphics->keymap : "en-us");
+        if (graphics->host) {
+                ret = asprintf(&_xml,
+                               "<graphics type='%s' port='%s' "
+                               "listen='%s' keymap='%s'/>\n",
+                               graphics->type,
+                               graphics->port,
+                               graphics->host,
+                               graphics->keymap != NULL ?
+                               graphics->keymap : "en-us");
+        }
+        else {
+                ret = asprintf(&_xml,
+                               "<graphics type='%s' port='%s' "
+                               "keymap='%s'/>\n",
+                               graphics->type,
+                               graphics->port,
+                               graphics->keymap != NULL ?
+                               graphics->keymap : "en-us");
+        }
+                
         if (ret == -1)
                 return false;
         else
openSUSE Build Service is sponsored by