Bug 1272121

Summary: Error: xmlParseDoc() failed - while creating new VM in virt-manager
Product: [Community] Virtualization Tools Reporter: James Boyle <unixi>
Component: virt-managerAssignee: Cole Robinson <crobinso>
Status: CLOSED UPSTREAM QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: berrange, crobinso, gscrivan, rbalakri
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-23 14:27:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Screenshot of the virt-manager failure none

Description James Boyle 2015-10-15 14:24:01 UTC
Created attachment 1083277 [details]
Screenshot of the virt-manager failure

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'>换敤ヲ楨歪浬潮煰獲￿睶￿￿￿翿膀￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿</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-23 12:35:39 UTC
*** Bug 1272125 has been marked as a duplicate of this bug. ***

Comment 2 James Boyle 2015-10-23 12:39:23 UTC
There were two reports because I had issues with Bugzilla and the malformed UTF (bugs 1272133 and 1272137). I marked 1272125 as a duplicate of this bug because 1272121 was the original.

Comment 3 Cole Robinson 2015-10-23 14:27:35 UTC
I addressed this in https://bugzilla.redhat.com/show_bug.cgi?id=1272125#c3