Bug 1388091

Summary: auto-addition of usb hub breaks gnome-boxes (& possibly other users of libvirt-gconfig)
Product: [Community] Virtualization Tools Reporter: Zeeshan Ali <zeeshanak>
Component: libvirt-glibAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED UPSTREAM QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: cfergeau, crobinso, libvirt-maint, rbalakri, stefan.home
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-17 07:58:11 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:

Description Zeeshan Ali 2016-10-24 12:39:57 UTC
Description of problem:

Seems newer libvirt (e.g 2.2.0 in Fedora 25) automatically adds usb hub in the domain xml configuration. Since libvirt-glib (libvirt-gconfig) doesn't know about this element, setting of libvirt xml fails with an error cause libvirt-gconfig omits xml it doesn't know about:

(gnome-boxes:26335): Boxes-WARNING **: libvirt-broker.vala:66: Failed to updatedomain 'fedora24-wor': Failed to set domain configuration: XML error: there is no hub at port 1 in USB address bus: 0 port: 1.1

Many users in different distros have been experiencing this issue, so it's kinda urgent: https://bugzilla.gnome.org/show_bug.cgi?id=772087

Version-Release number of selected component (if applicable): 2.2.0


How reproducible: 100%


Steps to Reproduce:
1. Run gnome-boxes
2. If you don't have a VM managed by Boxes already, create one

Actual results: You'll see the above mentioned error on the console when Boxes tries to write XML.

Expected results: Writing of XML to domain should not result in error.

Comment 1 Zeeshan Ali 2016-10-24 14:20:55 UTC
The problem lies here:

https://git.gnome.org/browse/gnome-boxes/tree/src/vm-configurator.vala#n255

since gvir_config_domain_get_devices() only returns the devices libvirt-gconfig knows about:

http://libvirt.org/git/?p=libvirt-glib.git;a=blob;f=libvirt-gconfig/libvirt-gconfig-domain.c;h=de84fd42176bd6536adaeff921ba4f963d31fa56;hb=086acea8d07dfc508fc6ff8c8b9d803ed3c55b76#l750

http://libvirt.org/git/?p=libvirt-glib.git;a=blob;f=libvirt-gconfig/libvirt-gconfig-domain-device.c;h=8a75ceac1ed6ee563a5409a6e9261dae9793cad2;hb=086acea8d07dfc508fc6ff8c8b9d803ed3c55b76#l99

IMO this is more a bug in libvirt-gconfig. Even if we add all known devices to it, if another is introduced in a new version, we can easily end up with this situation again.

Comment 2 Zeeshan Ali 2016-11-02 08:24:01 UTC
I have posted a few patches that should fix the issue: https://www.redhat.com/archives/libvir-list/2016-November/msg00031.html . Awaiting review now..

Comment 3 Zeeshan Ali 2016-11-04 11:09:05 UTC
(In reply to Zeeshan Ali from comment #2)
> I have posted a few patches that should fix the issue:
> https://www.redhat.com/archives/libvir-list/2016-November/msg00031.html .
> Awaiting review now..

They've now been merged and there will be a release today.

Comment 4 Christophe Fergeau 2016-11-17 07:58:11 UTC
Closing this as this is a bug against the upstream package and this is fixed in git/fixed in the libvirt-glib 1.0 release.