Bug 1376088

Summary: [libvirt] v1.3.3.2 rejects device parameters added by v2.2.0
Product: [Fedora] Fedora Reporter: Joachim Frieben <jfrieben>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: agedosier, berrange, clalancette, itamar, jdenemar, laine, libvirt-maint, veillard, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-15 07:31:54 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:

Description Joachim Frieben 2016-09-14 15:59:45 UTC
Description of problem:
After installing Fedora 24 in a virtual machine on a Fedora 24 host system and upgrading the host system to Fedora 25, the virtual machine continues to start up as expected.
However, after reverting the host system back to Fedora 24, any attempt to start the very same virtual machine (with gnome-boxes) aborts with the error message:

  "(gnome-boxes:10234): Boxes-WARNING **: machine.vala:606: Failed to start Fedora 24: Unable to start domain: internal error: process exited while connecting to monitor: 2016-09-13T22:32:08.409860Z qemu-system-x86_64: -device usb-redir,chardev=charredir1,id=redir1,bus=usb.0,port=1.1: usb port 1.1 (bus usb.0) not found (in use?)

(gnome-boxes:10234): Libvirt.GLib-CRITICAL **: cannot finish stream: this function is not supported by the connection driver: virStreamFinish"

Version-Release number of selected component (if applicable):
libvirt-1.3.3.2-1.fc24

How reproducible:
Always

Steps to Reproduce:
1. Install Fedora 24 virtual guest on a Fedora 24 host system.
2. Upgrade host system to Fedora 25.
3. Run virtual machine on Fedora 25 host system.
4. Revert host system to Fedora 24.
5. Launch virtual machine on Fedora 24 host system.

Actual results:
Start-up of virtual machine aborts with the above error message.

Expected results:
Start-up of virtual machine completes successfully.

Additional info:
Comparing the virtual machine's XML file on the Fedora 24 and on the Fedora 25 host systems reveals that libvirt-2.2.0-1.fc25 has added additional device parameters to the XML file which are rejected by libvirt-1.3.3.2-1.fc24, namely

  <input type='tablet' bus='usb'/>
  <input type='mouse' bus='usb'/>
  <input type='keyboard' bus='usb'/>

has been changed to

  <input type='tablet' bus='usb'>
    <address type='usb' bus='0' port='3'/>
  </input>
  <input type='mouse' bus='usb'>
    <address type='usb' bus='0' port='4'/>
  </input>
  <input type='keyboard' bus='usb'>
    <address type='usb' bus='0' port='5'/>
  </input>

and

  <redirdev bus='usb' type='spicevmc'/>
  <redirdev bus='usb' type='spicevmc'/>
  <redirdev bus='usb' type='spicevmc'/>
  <redirdev bus='usb' type='spicevmc'/>

has been changed to

  <redirdev bus='usb' type='spicevmc'>
    <address type='usb' bus='0' port='6'/>
  </redirdev>
  <redirdev bus='usb' type='spicevmc'>
    <address type='usb' bus='0' port='1.1'/>
  </redirdev>
  <redirdev bus='usb' type='spicevmc'>
    <address type='usb' bus='0' port='1.2'/>
  </redirdev>
  <redirdev bus='usb' type='spicevmc'>
    <address type='usb' bus='0' port='1.3'/>
  </redirdev> .

After restoring the original configuration, the corresponding virtual guest starts up on the Fedora 24 host system successfully.

Comment 1 Jiri Denemark 2016-09-15 07:31:54 UTC
Downgrading libvirt is not a supported operation. You'd need to change the domain XMLs manually.

Comment 2 Joachim Frieben 2016-09-15 09:31:54 UTC
(In reply to Jiri Denemark from comment #1)
Let me racall that the virtual machine was -created- under Fedora 24 and has been -altered- by Fedora 25 without any hint/warning.
For somebody who dares to test a development version of Fedora temporarily and finds his virtual machines corrupted by the latter after reverting his system back to the current stable release, your stance may sound a bit harsh.

Moreover, your advice requires a fairly good understanding of which components of Fedora are involved, which files to edit, and how. Boxes has just been created to make the use of virtual machines accessible even for an ordinary user of Fedora who is not interested in fiddling with anything not listed in the very GUI of Boxes.

Finally, is the potentially fatal adding of these (optional (?)) device parameters really necessary given that the virtual machine was running equally fine without them before?

Comment 3 Laine Stump 2016-09-15 13:32:05 UTC
To my knowledge, libvirt doesn't change any configuration files unless it is explicitly asked to do so by the user (or another management program that uses the libvirt API) - when you upgrade libvirt and restart it, it will read the existing config from disk and add any necessary new elements *in memory*, but those additions will not be written to disk unless you edit the configuration and tell it to re-save.

Based on that, my first suspicion would be that gnome-boxes is updating the config either for some internal reason, or possibly due to some change you made to the config after the upgrade. If you made no changes to the config and this happened, you should probably bring this up with the gnome-boxes developers.