Bug 1272125 - Error: xmlParseDoc() failed - while creating new VM in virt-manager
Error: xmlParseDoc() failed - while creating new VM in virt-manager
Status: CLOSED DUPLICATE of bug 1272121
Product: Virtualization Tools
Classification: Community
Component: virt-manager (Show other bugs)
unspecified
x86_64 Linux
unspecified Severity high
: ---
: ---
Assigned To: Cole Robinson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-15 10:26 EDT by James Boyle
Modified: 2015-10-23 08:35 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-10-15 16:39:02 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
virt-manager.log (3.10 KB, text/plain)
2015-10-15 10:28 EDT, James Boyle
no flags Details
Screenshot of virt-manager failure (23.88 KB, image/png)
2015-10-15 10:30 EDT, James Boyle
no flags Details

  None (edit)
Description James Boyle 2015-10-15 10:26:27 EDT
Description of problem:
Virt-manager is unable to handle a USB KVM (keyboard/video/mouse) with UTF/Chinese characters.  When the dongle is plugged in, virt-manager fails to create a new VM.  It is possible that other functions will fail.

The error message "Error: xmlParseDoc() failed" is shown in the GUI.

Version-Release number of selected component (if applicable):
libvirt-1.2.8-16.el7_1.4.x86_64
libvirt-client-1.2.8-16.el7_1.4.x86_64
libvirt-daemon-1.2.8-16.el7_1.4.x86_64
libvirt-daemon-config-network-1.2.8-16.el7_1.4.x86_64
libvirt-daemon-config-nwfilter-1.2.8-16.el7_1.4.x86_64
libvirt-daemon-driver-interface-1.2.8-16.el7_1.4.x86_64
libvirt-daemon-driver-lxc-1.2.8-16.el7_1.4.x86_64
libvirt-daemon-driver-network-1.2.8-16.el7_1.4.x86_64
libvirt-daemon-driver-nodedev-1.2.8-16.el7_1.4.x86_64
libvirt-daemon-driver-nwfilter-1.2.8-16.el7_1.4.x86_64
libvirt-daemon-driver-qemu-1.2.8-16.el7_1.4.x86_64
libvirt-daemon-driver-secret-1.2.8-16.el7_1.4.x86_64
libvirt-daemon-driver-storage-1.2.8-16.el7_1.4.x86_64
libvirt-glib-0.1.7-3.el7.x86_64
libvirt-python-1.2.8-7.el7_1.1.x86_64
virt-manager-1.1.0-12.el7.noarch
virt-manager-common-1.1.0-12.el7.noarch
virt-top-1.0.8-7.el7.x86_64
virt-what-1.13-5.el7.x86_64

How reproducible:
100% / All the time

Steps to Reproduce:
1.  Plug in USB KVM dongle with ID: 3032:1b1c (probably other USB devices with UTF/odd characters in the product description)
2.  Run virt-manager
3.  Click on the button to create a new VM

Actual results:
Virt-manager fails to launch the create new VM dialog (see screenshot).

Expected results:
New VM dialog should launch.

Additional info:
The host system is a current CentOS 7 installation.

From the virt-manager log:
[Thu, 15 Oct 2015 07:22:39 virt-manager 17261] DEBUG (create:165) Showing new vm wizard
[Thu, 15 Oct 2015 07:22:39 virt-manager 17261] DEBUG (create:892) Guest type set to os_type=hvm, arch=x86_64, dom_type=kvm
[Thu, 15 Oct 2015 07:22:46 virt-manager 17261] DEBUG (xmlbuilder:693) Error parsing xml=
<device>
  <name>usb_2_1_4</name>
  <path>/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4</path>
  <parent>usb_2_1</parent>
  <driver>
    <name>usb</name>
  </driver>
  <capability type='usb_device'>
    <bus>2</bus>
    <device>6</device>
    <product id='0x1b1c'>*** I deleted the info here so bugzilla won't crash!!!! ***</product>
    <vendor id='0x3032'>䙸〄䜀                             </vendor>
  </capability>
</device>

[Thu, 15 Oct 2015 07:22:46 virt-manager 17261] ERROR (create:346) Error setting create wizard conn state.
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/create.py", line 344, in reset_state
    self.set_conn(activeconn, force_validate=True)
  File "/usr/share/virt-manager/virtManager/create.py", line 225, in set_conn
    self.set_conn_state()
  File "/usr/share/virt-manager/virtManager/create.py", line 626, in set_conn_state
    self.netlist.reset_state()
  File "/usr/share/virt-manager/virtManager/netlist.py", line 405, in reset_state
    self._populate_network_list()
  File "/usr/share/virt-manager/virtManager/netlist.py", line 253, in _populate_network_list
    vnet_bridges)
  File "/usr/share/virt-manager/virtManager/netlist.py", line 185, in _find_physical_devices
    for nodedev in self.conn.get_nodedevs("net"):
  File "/usr/share/virt-manager/virtManager/connection.py", line 644, in get_nodedevs
    xmlobj = dev.get_xmlobj()
  File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 160, in get_xmlobj
    self._reparse_xml()
  File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 225, in _reparse_xml
    self._xmlobj = self._build_xmlobj(self._get_raw_xml())
  File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 228, in _build_xmlobj
    return self._parseclass(self.conn.get_backend(), parsexml=xml)
  File "/usr/share/virt-manager/virtManager/nodedev.py", line 27, in _parse_convert
    return NodeDevice.parse(conn, parsexml)
  File "/usr/share/virt-manager/virtinst/nodedev.py", line 89, in parse
    tmpdev = NodeDevice(conn, parsexml=xml, allow_node_instantiate=True)
  File "/usr/share/virt-manager/virtinst/nodedev.py", line 100, in __init__
    XMLBuilder.__init__(self, *args, **kwargs)
  File "/usr/share/virt-manager/virtinst/xmlbuilder.py", line 776, in __init__
    parent_xpath, relative_object_xpath)
  File "/usr/share/virt-manager/virtinst/xmlbuilder.py", line 678, in __init__
    self._parse(parsexml, parsexmlnode)
  File "/usr/share/virt-manager/virtinst/xmlbuilder.py", line 691, in _parse
    doc = libxml2.parseDoc(xml)
  File "/usr/lib64/python2.7/site-packages/libxml2.py", line 1325, in parseDoc
    if ret is None:raise parserError('xmlParseDoc() failed')
parserError: xmlParseDoc() failed
[Thu, 15 Oct 2015 07:23:01 virt-manager 17261] DEBUG (create:175) Closing new vm wizard
Comment 1 James Boyle 2015-10-15 10:28 EDT
Created attachment 1083281 [details]
virt-manager.log

this contains the offending UTF input in the virt-manager.log - bugzilla was unable to process it in the description field, so I'm attaching it.
Comment 2 James Boyle 2015-10-15 10:30 EDT
Created attachment 1083283 [details]
Screenshot of virt-manager failure

It didn't look like this attachment made it from the original submission - I think bugzilla is having trouble with the malformed UTF from our USB device product description.  Sorry if this shows up twice.
Comment 3 Cole Robinson 2015-10-15 16:39:02 EDT
Thanks for the report, but this is already fixed upstream:

commit e125aa69d8024fddb72dde9371f172061f388160
Author: Cole Robinson <crobinso@redhat.com>
Date:   Thu Mar 26 18:04:23 2015 -0400

    nodedev: Handle busted 'system' XML
    
    Libvirt can generated invalid XML for the system nodedev device:
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1184131
    
    This hits at least two people, so catch this specific case, but the
    real fix is libvirt not outputing busted XML.

It looks like you're on RHEL/Centos, and RHEL7.2 should have that patch when it's finally out. You can try running virt-manager git until then:

git clone git://github.com/virt-manager/virt-manager
cd virt-manager
./virt-manager --debug
Comment 4 James Boyle 2015-10-23 08:35:39 EDT

*** This bug has been marked as a duplicate of bug 1272121 ***

Note You need to log in before you can comment on or make changes to this bug.