[libvirt] Fix qemudParseVMDeviceDef() to check for proper network device tag name

Is it too late to get this change in? Instead of "net", the tag name should be "interface". Previously, attempting to attach a network device to a KVM guest would return: libvir: QEMU error : XML description for unknown device type is not well formed or invalid error: Failed to attach device from attach-disk.xml With this fix, it returns: libvir: QEMU error test_domain: this function is not supported by the hypervisor: only CDROM disk devices can be attached libvir: QEMU error : this function is not supported by the hypervisor: only CDROM disk devices can be attached error: Failed to attach device from attach-disk.xml Index: src/qemu_conf.c =================================================================== RCS file: /data/cvs/libvirt/src/qemu_conf.c,v retrieving revision 1.77 diff -u -p -r1.77 qemu_conf.c --- src/qemu_conf.c 12 Jun 2008 10:19:24 -0000 1.77 +++ src/qemu_conf.c 12 Jun 2008 16:17:59 -0000 @@ -2964,7 +2964,7 @@ qemudParseVMDeviceDef(virConnectPtr conn if (xmlStrEqual(node->name, BAD_CAST "disk")) { dev->type = QEMUD_DEVICE_DISK; qemudParseDiskXML(conn, &(dev->data.disk), node); - } else if (xmlStrEqual(node->name, BAD_CAST "net")) { + } else if (xmlStrEqual(node->name, BAD_CAST "interface")) { dev->type = QEMUD_DEVICE_NET; qemudParseInterfaceXML(conn, &(dev->data.net), node); } else if (xmlStrEqual(node->name, BAD_CAST "input")) { -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com

On Thu, Jun 12, 2008 at 09:22:20AM -0700, Kaitlin Rupert wrote:
Is it too late to get this change in?
Sorry, off by a couple of hours !
Instead of "net", the tag name should be "interface". Previously, attempting to attach a network device to a KVM guest would return:
libvir: QEMU error : XML description for unknown device type is not well formed or invalid error: Failed to attach device from attach-disk.xml
With this fix, it returns:
libvir: QEMU error test_domain: this function is not supported by the hypervisor: only CDROM disk devices can be attached libvir: QEMU error : this function is not supported by the hypervisor: only CDROM disk devices can be attached error: Failed to attach device from attach-disk.xml
Hum, right a network device description uses "interface", not "net" that's clear from both the doc and qemudParseXML(), so applied and commited, but infortunately it didn't made into 0.4.3 :-\ thanks ! Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

On Fri, Jun 13, 2008 at 03:57:05AM -0400, Daniel Veillard wrote:
On Thu, Jun 12, 2008 at 09:22:20AM -0700, Kaitlin Rupert wrote:
Is it too late to get this change in?
Sorry, off by a couple of hours !
Instead of "net", the tag name should be "interface". Previously, attempting to attach a network device to a KVM guest would return:
libvir: QEMU error : XML description for unknown device type is not well formed or invalid error: Failed to attach device from attach-disk.xml
With this fix, it returns:
libvir: QEMU error test_domain: this function is not supported by the hypervisor: only CDROM disk devices can be attached libvir: QEMU error : this function is not supported by the hypervisor: only CDROM disk devices can be attached error: Failed to attach device from attach-disk.xml
Hum, right a network device description uses "interface", not "net" that's clear from both the doc and qemudParseXML(), so applied and commited, but infortunately it didn't made into 0.4.3 :-\
That's not critical - this function is only called from the device hotplug driver API, and we only implement that for changing CDROM media in QEMU at the moment. So nothing we actually use for real is broken. Regards, Daniel. -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

libvir: QEMU error test_domain: this function is not supported by the hypervisor: only CDROM disk devices can be attached libvir: QEMU error : this function is not supported by the hypervisor: only CDROM disk devices can be attached error: Failed to attach device from attach-disk.xml Hum, right a network device description uses "interface", not "net" that's clear from both the doc and qemudParseXML(), so applied and commited, but infortunately it didn't made into 0.4.3 :-\
That's not critical - this function is only called from the device hotplug driver API, and we only implement that for changing CDROM media in QEMU at the moment. So nothing we actually use for real is broken.
Right, since attaching a network device isn't supported, you'd get an error either way. I tracked down this issue because I saw the following error when I attempted to attach a network device: libvir: QEMU error : XML description for unknown device type is not well formed or invalid I originally thought I wasn't formatting the XML properly. Once I looked at the code, I realized that the action wasn't supported. So, this change just saves some potential confusion. -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com

KR> I originally thought I wasn't formatting the XML properly. Once I KR> looked at the code, I realized that the action wasn't supported. KR> So, this change just saves some potential confusion. It also helps generalized layers above libvirt handle the error. In the CIM providers, we can ignore (or handle) "not supported" properly, but "XML not well-formed" is a more fatal error, indicating a problem with the providers. The fewer this-is-kvm-so-only-cdroms-are-dynamic special cases we have, the better :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com
participants (4)
-
Dan Smith
-
Daniel P. Berrange
-
Daniel Veillard
-
Kaitlin Rupert