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 1430275 - cannot attach a virtual disk **with iothread enabled** to vm if pci address not provided
Summary: cannot attach a virtual disk **with iothread enabled** to vm if pci address n...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.4
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Pavel Hrdina
QA Contact: jiyan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-08 09:30 UTC by yisun
Modified: 2017-08-02 00:03 UTC (History)
7 users (show)

Fixed In Version: libvirt-3.2.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 17:24:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:1846 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2017-08-01 18:02:50 UTC

Description yisun 2017-03-08 09:30:37 UTC
Description of problem:
cannot attach a virtual disk **with iothread enabled** to vm if pci address not provided

Version-Release number of selected component (if applicable):
libvirt-3.1.0-1.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. having a vm with iothreads enabled
## virsh dumpxml vm1 | grep iothreads -a10
<domain type='kvm' id='10'>
 ...
  <iothreads>4</iothreads>
 ...

2.start the vm
## virsh start vm1
Domain vm1 started

3.prepare a disk xml
## cat disk1.xml 
<disk device="disk" type="file">
    <driver name="qemu"  iothread='1'/>
    <source file="/var/lib/libvirt_ci/runtest_avocado-vt/avocado-vt/shared/test.raw" />
    <target bus="virtio" dev="vdb" />
</disk>

4. attach the disk to vm
## virsh attach-device vm1 disk1.xml 
error: Failed to attach device from disk1.xml
error: unsupported configuration: IOThreads are only available for virtio pci and virtio ccw disk


Actual results:
attaching failed, with error as above

Expected results:
Attaching successfully

Additional info:
1. this is not reproducible with libvirt-3.0.0-2.el7.x86_64
2. if pci address explicitly added in disk xml, then attach will be successful
## cat disk2.xml 
<disk device="disk" type="file">
    <driver name="qemu"  iothread='1'/>
    <source file="/var/lib/libvirt_ci/runtest_avocado-vt/avocado-vt/shared/test.raw" />
    <target bus="virtio" dev="vdb" />
    <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</disk>

## virsh attach-device vm1 disk2.xml 
Device attached successfully

Comment 3 Jaroslav Suchanek 2017-03-08 10:43:51 UTC
Result of this?

commit c96bd78e4e71c799dc391566fa9f0652dec55dca
Author:     Pavel Hrdina <phrdina>
AuthorDate: Sun Feb 12 15:05:53 2017 +0100
Commit:     Pavel Hrdina <phrdina>
CommitDate: Mon Feb 20 18:42:24 2017 +0100

    conf: move iothread XML validation from qemu_command
    
    This will ensure that IOThreads are properly validated while
    a domain is defined.
    
    Signed-off-by: Pavel Hrdina <phrdina>

Comment 4 Pavel Hrdina 2017-03-08 11:55:53 UTC
Yes it is a result of that commit, I'll fix it ASAP.

Comment 5 Pavel Hrdina 2017-03-08 16:51:13 UTC
Upstream patch posted:

https://www.redhat.com/archives/libvir-list/2017-March/msg00355.html

Comment 6 Pavel Hrdina 2017-03-09 16:42:23 UTC
Upstream commit:

commit cba1672de8b0220869ede5f9f26a0767e8a390eb
Author: Pavel Hrdina <phrdina>
Date:   Mon Feb 27 17:16:17 2017 +0100

    conf: properly skip graphics listen element in migratable XML

Comment 7 Pavel Hrdina 2017-03-09 16:44:18 UTC
Ahem, upstream commit:

commit c27020dd4f6ddb9ef5354e75dc7005a5efafe536
Author: Pavel Hrdina <phrdina>
Date:   Thu Mar 9 14:55:44 2017 +0100

    Revert "conf: move iothread XML validation from qemu_command"

Comment 10 jiyan 2017-06-01 03:07:18 UTC
Version-Release number of selected component:
libvirt-3.2.0-6.el7.x86_64
qemu-kvm-rhev-2.9.0-7.el7.x86_64
Kernel-3.10.0-675.el7.x86_64

Steps to verify:
1.configure the vm with iothreads enabled ,prepare disk.xml without pci address and disk1.xml with pci address 
# virsh dumpxml cow |grep iothreads
  <iothreads>4</iothreads>

# cat disk.xml 
<disk device="disk" type="file">
    <driver name="qemu"  iothread='1'/>
    <source file="/var/lib/libvirt/images/RHEL-7.4-x86_64-latest.raw" />
    <target bus="virtio" dev="vda" />
</disk>

# cat disk1.xml 
<disk device="disk" type="file">
    <driver name="qemu"  iothread='1'/>
    <source file="/var/lib/libvirt/images/RHEL-7.4-x86_64-latest.raw" />
    <target bus="virtio" dev="vda" />
    <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</disk>

2.confirm the vm can start and destroy normally with iothreads enabled 
# virsh start cow
Domain cow started

# virsh destroy cow
Domain cow destroyed

3.confirm that the disk.xml without  pci address can be attached and dettached normally when vm is running, check 'disk' element in dumpxml file  
# virsh start cow
Domain cow started

# virsh attach-device cow disk.xml 
Device attached successfully

# virsh dumpxml cow |grep "<disk" -A 10
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' iothread='1'/>
      <source file='/var/lib/libvirt/images/RHEL-7.4-x86_64-latest.raw'/>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </disk>

# virsh detach-device cow disk.xml 
Device detached successfully

4.confirm that the disk1.xml with  pci address can be attached and dettached normally when vm is running, check 'disk' element in dumpxml file  
# virsh start cow
Domain cow started

# virsh attach-device cow disk1.xml 
Device attached successfully

# virsh dumpxml cow |grep "<disk" -A 10
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' iothread='1'/>
      <source file='/var/lib/libvirt/images/RHEL-7.4-x86_64-latest.raw'/>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </disk>

# virsh detach-device cow disk1.xml 
Device detached successfully

5.confirm that neither disk.xml(without pci address) or disk1.xml(with pci address) can be attached when the vm is down
# virsh destroy cow
Domain cow destroyed

# virsh attach-device cow disk.xml 
error: Failed to attach device from disk.xml
error: Requested operation is not valid: domain is not running

# virsh attach-device cow disk1.xml 
error: Failed to attach device from disk1.xml
error: Requested operation is not valid: domain is not running

Comment 11 errata-xmlrpc 2017-08-01 17:24:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:1846

Comment 12 errata-xmlrpc 2017-08-02 00:03:43 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:1846


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