[Libvir] [PATCH] Fix strange message on virsh attach-device

Masayuki Sunou fj1826dm at aa.jp.fujitsu.com
Fri Jul 13 05:24:08 UTC 2007


Hi

Virsh attach-device outputs a strange message,
when XML whose top element is not <device> or <interface>.
----------------------------------------------------------------------
libvir: Xen Daemon error : POST operation failed: (xend.err "object of type 'NoneType' has no len()")
error: Failed to attach device from test.xml
----------------------------------------------------------------------

This patch fixes it by not calling Xen in this case.

Signed-off-by: Masayuki Sunou <fj1826dm at aa.jp.fujitsu.com>

Thanks,
Masayuki Sunou.

----------------------------------------------------------------------
Index: libvirt/src/xml.c
===================================================================
RCS file: /data/cvs/libvirt/src/xml.c,v
retrieving revision 1.81
diff -u -p -r1.81 xml.c
--- libvirt/src/xml.c	11 Jul 2007 08:41:11 -0000	1.81
+++ libvirt/src/xml.c	13 Jul 2007 02:48:04 -0000
@@ -1337,6 +1337,8 @@ virParseXMLDevice(virConnectPtr conn, ch
     else if (xmlStrEqual(node->name, BAD_CAST "interface")) {
         if (virDomainParseXMLIfDesc(conn, node, &buf, hvm, xendConfigVersion) != 0)
             goto error;
+    } else {
+        goto error;
     }
  cleanup:
     if (xml != NULL)




More information about the libvir-list mailing list