[PATCH] Fix strange message on virsh attach-device

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

 



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@xxxxxxxxxxxxxxxxx>

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)

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]