Bug 1229819

Summary: Cannot connect media if cdrom is boot device
Product: [Fedora] Fedora Reporter: adruch2002
Component: virt-managerAssignee: Cole Robinson <crobinso>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: berrange, crobinso, loganrodrian, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: virt-manager-1.2.1-2.fc22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-18 05:14:20 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
virt-manager debug logging output none

Description adruch2002 2015-06-09 17:26:28 UTC
Created attachment 1036923 [details]
virt-manager debug logging output

Description of problem:

If a guest is running and the CDROM is a boot device, media cannot be connected. Some more details are available in this mailing list entry (https://lists.fedoraproject.org/pipermail/virt/2015-June/004288.html), however I was able to simply the steps to reproduce the issue to what is shown below.

https://lists.fedoraproject.org/pipermail/virt/2015-June/004288.html

Version-Release number of selected component (if applicable):
virt-manager-1.2.0-1.fc22.noarch
libvirt-1.2.13.1-2.fc22.x86_64


How reproducible:
100%

Steps to Reproduce:
1. In virt-manager, open details window for powered-off guest
2. Under "Boot Options", enable empty CDROM as boot device. 
3. Start guest, which should work fine.
4. In the virt-manager details window, attempt to attach a source ISO to the CDROM device. 

Actual results:

summary=These changes will take effect after the next guest shutdown.
details=unsupported configuration: boot order 2 is already used by another device

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/addhardware.py", line 1420, in change_config_helper
    define_func(devobj=devobj, do_hotplug=True, **define_args)
  File "/usr/share/virt-manager/virtManager/domain.py", line 804, in define_disk
    self.hotplug(**hotplug_kwargs)
  File "/usr/share/virt-manager/virtManager/domain.py", line 1111, in hotplug
    self.attach_device(device)
  File "/usr/share/virt-manager/virtManager/domain.py", line 1041, in attach_device
    self._backend.attachDevice(devxml)
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 508, in attachDevice
    if ret == -1: raise libvirtError ('virDomainAttachDevice() failed', dom=self)
libvirtError: unsupported configuration: boot order 2 is already used by another device

Expected results:
Expected it to work

Additional info:
Attached is the debug log output from virt-manager

Comment 1 Logan Rodrian 2015-06-15 15:44:45 UTC
I am also witnessing this issue after upgrading to Fedora 22 with a similar use case, but can also reproduce the case described by adruch2002 with the same package versions and results.

Comment 2 Cole Robinson 2015-08-10 23:07:27 UTC
Thanks for the report. Fixed by having virt-manager finally use libvirt UpdateDevice for disk media change, it's been around a long time now:

commit 40d4c378680275ee432fbf4825c55737bc8c3fc2
Author: Cole Robinson <crobinso>
Date:   Mon Aug 10 18:30:12 2015 -0400

    domain: Use UpdateDevice for CDROM media change (bz 1229819)

Comment 3 Fedora Update System 2015-08-11 20:11:56 UTC
virt-manager-1.2.1-2.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/virt-manager-1.2.1-2.fc22

Comment 4 Fedora Update System 2015-08-13 16:53:49 UTC
Package virt-manager-1.2.1-2.fc22:
* should fix your issue,
* was pushed to the Fedora 22 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing virt-manager-1.2.1-2.fc22'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-13390/virt-manager-1.2.1-2.fc22
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2015-08-18 05:14:20 UTC
virt-manager-1.2.1-2.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.