RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 983616 - virsh attach-device XML error with valid XML
Summary: virsh attach-device XML error with valid XML
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.4
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 982304
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-11 14:40 UTC by Chris Evich
Modified: 2014-04-04 20:57 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 982304
Environment:
Last Closed: 2014-04-04 20:57:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Chris Evich 2013-07-11 14:40:32 UTC
+++ This bug was initially created as a clone of Bug #982304 +++

Description of problem:
With valid XML, attaching a device with 'virsh attach-device' doesn't work when virt-manager does.

error: Failed to attach device from /tmp/serial.xml
error: XML error: unknown device type


Version-Release number of selected component (if applicable):
libvirt-0.10.2-18.el6_4.8.x86_64

How reproducible:
Very

Steps to Reproduce:

Scenario A-
1. Shutdown/destroy qemu-kvm domain.
2. Confirm domain is NOT running.
3. virsh attach-device foobar /tmp/serial.xml --config

Scenario B-
1. start qemu-kvm domain, OS doesn't matter
2. Open domain in virt-manager, click add device
3. Manually add file-backed serial device as in XML.
4. Review error in 'details' box of error dialog.
5. Click Yes, restart domain.
6. Device attached and working as expected.


Actual results:

Scenario A- "error: XML error: unknown device type" when device is known, XML is valid, and supported for off-line attachment (Scenario C)

Scenario B- Error dialog, offering to perform off-line device addition.  Detail box concludes with: "error: XML error: unknown device type".


Expected results:

Scenario A- Serial device is successfully attached to off-line domain.

Scenario B- Any device attachable via virt-manager, should be attachable in similar way through virsh attach-device command.

Additional info:

XML used was:

<serial type='file'>
  <source path='/tmp/serialfile'/>
  <target port='1'/>
</serial>

where /tmp/serialfile does not already exist.

--- Additional comment from Michal Privoznik on 2013-07-11 02:58:04 EDT ---

(In reply to Chris Evich from comment #0)
> Expected results:
> 
> Scenario A- An error message indicating device could not be hotplugged.
> 
> Scenario B- Serial device is successfully attached to off-line domain.
> 
> Scenario C- Any device attachable via virt-manager, should be attachable in
> similar way through virsh attach-device command.

I think when coldplugging a device, virt-manager just dumps domain XML, inserts the device XML snip and re-define domain. Question is - do we want virsh attach-device --config to do the same?

Comment 2 Michal Privoznik 2013-07-12 07:37:48 UTC
Is this something that's really needed in 6.5? The original bug was targetet to 6.6.

Comment 3 Chris Evich 2013-07-12 14:04:44 UTC
Nope, nothing urgent from my side, just working on writing a QE test and noticed this problem.  RHEL 6.6 is fine.

Comment 4 Michal Privoznik 2013-09-05 12:47:46 UTC
Patches are upstream:

commit 95ff6a3993436daa3d1bb46ffc9d3be3530c00a6
Author:     Michal Privoznik <mprivozn>
AuthorDate: Thu Jul 11 13:24:20 2013 +0200
Commit:     Michal Privoznik <mprivozn>
CommitDate: Thu Jul 11 16:19:10 2013 +0200

    qemu: Fix hot (un-)plug error codes and messages
    
    With current code, error reporting for unsupported devices for hot plug,
    unplug and update is total mess. The VIR_ERR_CONFIG_UNSUPPORTED error
    code is reported instead of VIR_ERR_OPERATION_UNSUPPORTED. Moreover, the
    error messages are not helping to find the root cause (lack of
    implementation).

commit 38f151fe9b2e3f235fa8537b06f21ee7d42aed72
Author:     Michal Privoznik <mprivozn>
AuthorDate: Thu Jul 11 12:18:36 2013 +0200
Commit:     Michal Privoznik <mprivozn>
CommitDate: Thu Jul 11 16:19:00 2013 +0200

    conf: Rework virDomainDeviceDefParse
    
    When adding a new domain device, it is fairly easy to forget to add
    corresponding piece into virDomainDeviceDefParse. However, if the
    internal structure is changed to one bit switch() the compiler will warn
    about not handled enum item.

commit b63ea467617e3cbee4282ab2e5e780b4119cef3d
Author:     Michal Privoznik <mprivozn>
AuthorDate: Thu Jul 11 11:20:34 2013 +0200
Commit:     Michal Privoznik <mprivozn>
CommitDate: Thu Jul 11 16:07:04 2013 +0200

    conf: Extend device types handled by virDomainDeviceDefParse
    
    Not all device types are currently parsed in virDomainDeviceDefParse,
    Since all needed functions do exist, nothing holds us back to make the
    implementation complete. Similarly, the virDomainDeviceDefFree needs to
    be updated as well.

CVE-2013-2230-49-gb0cb524

I am setting Keyword Upstream to reflect the fact that patches are upstream.

Comment 7 RHEL Program Management 2014-04-04 20:57:36 UTC
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.


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