[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] avoid dumpXML segfault with recent Xen (3.4.0)



  This is basically the patch by Sascha at
    https://bugzilla.redhat.com/show_bug.cgi?id=503254
with a couple of cleanups. I think it's low risk, and avoid a crash so I
commited it.
Basically ths SXPR syntax changed from (type vnc) to (vnc 1) for VNC
vfb devices, and assuming something similar for sdl. The code checks
first for type then backoff for vnc/sdl  so I think this is backward
compatible.

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/
Index: src/xend_internal.c
===================================================================
RCS file: /data/cvs/libxen/src/xend_internal.c,v
retrieving revision 1.264
diff -u -u -p -r1.264 xend_internal.c
--- src/xend_internal.c	12 Jun 2009 12:06:15 -0000	1.264
+++ src/xend_internal.c	26 Jun 2009 18:13:27 -0000
@@ -2079,7 +2079,15 @@ xenDaemonParseSxprGraphicsNew(virConnect
         if (sexpr_lookup(node, "device/vfb")) {
             /* New style graphics config for PV guests in >= 3.0.4,
              * or for HVM guests in >= 3.0.5 */
-            tmp = sexpr_node(node, "device/vfb/type");
+            if (sexpr_node(node, "device/vfb/type")) {
+                tmp = sexpr_node(node, "device/vfb/type");
+            } else if (sexpr_node(node, "device/vfb/vnc")) {
+                tmp = "vnc";
+            } else if (sexpr_node(node, "device/vfb/sdl")) {
+                tmp = "sdl";
+            } else {
+                tmp = "unknown";
+            }
 
             if (VIR_ALLOC(graphics) < 0)
                 goto no_memory;

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]