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(a)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)