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 2021437 - hotplug interface with ROM setting failed
Summary: hotplug interface with ROM setting failed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: libvirt
Version: 9.0
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Yanqiu Zhang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-09 08:40 UTC by yalzhang@redhat.com
Modified: 2022-05-17 13:05 UTC (History)
9 users (show)

Fixed In Version: libvirt-7.10.0-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-17 12:45:49 UTC
Type: Bug
Target Upstream Version: 7.10.0
Embargoed:
yanqzhan: needinfo-


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-102067 0 None None None 2021-11-09 08:42:10 UTC
Red Hat Product Errata RHBA-2022:2390 0 None None None 2022-05-17 12:46:14 UTC

Description yalzhang@redhat.com 2021-11-09 08:40:26 UTC
Description of problem:
ROM tuning for interface is no longer supported

Version-Release number of selected component (if applicable):
# rpm -q libvirt qemu-kvm
libvirt-7.9.0-1.el9.x86_64
qemu-kvm-6.1.0-6.el9.x86_64

How reproducible:
100%

Steps to Reproduce:
1. start a vm, prepare an interface xml with rom element:
# cat interface.xml
<interface type='network'>
  <source network='default'/>
  <model type='virtio'/>
  <rom enabled='no'/>
</interface>

2. try hotplug the interface:
# virsh attach-device 1 interface.xml
error: Failed to attach device from interface.xml
error: unsupported configuration: ROM tuning is only supported for PCI devices

# cat /var/log/libvirt/libvirtd.log | grep -i error
2021-11-09 08:16:58.775+0000: 155408: error : qemuValidateDomainDeviceInfo:1489 : unsupported configuration: ROM tuning is only supported for PCI devices

Actual results:
hotplug fail with error "ROM tuning is only supported for PCI devices"

Expected results:
should succeed

Additional info:
no issue in libvirt-7.8.0-1.el9.x86_64

Comment 1 Peter Krempa 2021-11-26 09:05:06 UTC
commit a453ebcd2bfb63ba3fc85e9c39bcdcf47c3d9f1c 
Author: Peter Krempa <pkrempa>
Date:   Thu Nov 25 16:17:16 2021 +0100

    qemu: Fix validation of PCI option rom settings on hotplug
    
    Commit 24be92b8e moved the option rom settings validation code to the
    validation callbacks, but that doesn't work properly with device hotplug
    as we assign addresses only after parsing the whole XML. The check is
    too strict for that and caused failures when hotplugging devices such
    as:
    
     <interface type='network'>
       <source network='default'/>
       <model type='virtio'/>
       <rom enabled='no'/>
     </interface>
    
    This patch relaxes the check in the validation callback to accept also
    _NONE and _UNASSIGNED address types and returns the check to
    'qemuBuildRomProps' so that we preserve the full validation as we've
    used to.
    
    Fixes: 24be92b8e38762e9ba13e
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2021437
    Signed-off-by: Peter Krempa <pkrempa>
    Reviewed-by: Ján Tomko <jtomko>

v7.10.0-rc1-3-ga453ebcd2b

Comment 2 yalzhang@redhat.com 2021-12-02 04:40:23 UTC
Auto job run with libvirt-7.10.0-1.el9.x86_64 and there is no such issue.

Comment 5 Yanqiu Zhang 2022-01-13 09:01:59 UTC
Reproduced on:
liibvirt-7.9.0-1.el9.x86_64
qemu-kvm-6.2.0-3.el9.x86_64

Steps:
1. none address
(1)interface
# virsh attach-device r8 iface-romno-none.xml 
error: Failed to attach device from iface-romno-none.xml
error: unsupported configuration: ROM tuning is only supported for PCI devices

(2)hostdev
# cat hostdev-romno-none.xml
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x3b' slot='0x0a' function='0x0'/>
      </source>
      <alias name='hostdev0'/>
      <rom enabled='no'/>
    </hostdev>

# virsh attach-device r8 hostdev-romno-none.xml 
error: Failed to attach device from hostdev-romno-none.xml
error: unsupported configuration: ROM tuning is only supported for PCI devices


2. address type='unassigned'
Since it’s only valid for PCI hostdevs:
# cat hostdev-romno-unassigned.xml 
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x3b' slot='0x0a' function='0x0'/>
      </source>
      <alias name='hostdev0'/>
      <rom enabled='no'/>
      <address type='unassigned'/>
    </hostdev>

# virsh attach-device r8 hostdev-romno-unassigned.xml 
error: Failed to attach device from hostdev-romno-unassigned.xml
error: unsupported configuration: ROM tuning is only supported for PCI devices



Verified on:
# rpm -q libvirt qemu-kvm
libvirt-8.0.0-0rc1.1.el9.x86_64
Qemu-kvm-6.2.0-3.el9.x86_64

1. # virsh attach-device r8 iface-romno-none.xml 
Device attached successfully

# virsh dumpxml r8|grep /interface -B8
    <interface type='network'>
      <mac address='52:54:00:96:4d:35'/>
      <source network='default' portid='bdf43f4f-67e9-41d3-aef3-018965a40369' bridge='virbr0'/>
      <target dev='vnet7'/>
      <model type='virtio'/>
      <alias name='net3'/>
      <rom enabled='no'/>
      <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
    </interface>

(2)# virsh attach-device r8 hostdev-romno-none.xml
Device attached successfully

# virsh dumpxml r8|grep /hostdev -B8
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x3b' slot='0x0a' function='0x0'/>
      </source>
      <alias name='hostdev0'/>
      <rom enabled='no'/>
      <address type='pci' domain='0x0000' bus='0x09' slot='0x00' function='0x0'/>
    </hostdev>

2.
# virsh attach-device r8 hostdev-romno-unassigned.xml 
Device attached successfully

# virsh dumpxml r8|grep /hostdev -B8
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x3b' slot='0x0a' function='0x0'/>
      </source>
      <alias name='hostdev0'/>
      <rom enabled='no'/>
      <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
    </hostdev>

3. Regression test for address=pci:
(1)<interface type='network'>
  <source network='default'/>
  <model type='virtio'/>
  <rom enabled='no'/>
  <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
</interface>

# virsh attach-device r8 iface-romno-pci.xml 
Device attached successfully

(2)# cat hostdev-romno-pci.xml
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x3b' slot='0x0a' function='0x0'/>
      </source>
      <alias name='hostdev0'/>
      <rom enabled='no'/>
            <address type='pci' domain='0x0000' bus='0x09' slot='0x00' function='0x0'/>
    </hostdev>
# virsh attach-device r8 hostdev-romno-pci.xml 
Device attached successfully

Comment 6 Yanqiu Zhang 2022-01-13 09:10:30 UTC
Hi Peter,

I found an issue when test 'unassigned' address hostdev. Could you help check?

If start guest with hostdev, <address type='unassigned'/> will not change in live xml. But if hotplug a hostdev with 'unassigned' address, it will changed to normal pci address.

1.start with
# virsh dumpxml r8|grep hostdev -B8
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x3b' slot='0x0a' function='0x0'/>
      </source>
      <rom enabled='no'/>
      <address type='unassigned'/>
    </hostdev>

# virsh start r8
Domain 'r8' started

# virsh dumpxml r8|grep hostdev -B8
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x3b' slot='0x0a' function='0x0'/>
      </source>
      <alias name='hostdev0'/>
      <rom enabled='no'/>
      <address type='unassigned'/>
    </hostdev>

2.hotplug
# virsh dumpxml r8|grep /hostdev -B8
(no output)
# cat hostdev-romno-unassigned.xml 
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x3b' slot='0x0a' function='0x0'/>
      </source>
      <alias name='hostdev0'/>
      <rom enabled='no'/>
      <address type='unassigned'/>
    </hostdev>

# virsh attach-device r8 hostdev-romno-unassigned.xml
Device attached successfully

# virsh dumpxml r8|grep /hostdev -B8
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x3b' slot='0x0a' function='0x0'/>
      </source>
      <alias name='hostdev0'/>
      <rom enabled='no'/>
      <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
    </hostdev>

Is this designed as it. Or should I open a new bug to track it?

Thank you.

Comment 7 Peter Krempa 2022-01-13 09:26:37 UTC
I'm sorry but that is not really related to this bug and I don't know how that is supposed to work.

Comment 8 Yanqiu Zhang 2022-01-13 11:03:24 UTC
Mark this bug as verified per comment 5.

Comment 9 Yanqiu Zhang 2022-01-13 11:14:35 UTC
Hi Cole,

I found address type='unassigned' was involved by your reviewed commits. https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=96999404cb3bfcdb0f169857d9a0ea3d602cbc43
I'm not familiar with it. So could you help check the issue in comment 6 please?

Thank you!

Comment 10 Yanqiu Zhang 2022-01-14 03:15:46 UTC
(In reply to yanqzhan from comment #9)
> Hi Cole,
> 
> I found address type='unassigned' was involved by your reviewed commits.
> https://libvirt.org/git/?p=libvirt.git;a=commitdiff;
> h=96999404cb3bfcdb0f169857d9a0ea3d602cbc43
> I'm not familiar with it. So could you help check the issue in comment 6
> please?
> 
> Thank you!

Track in bz2040548.

Comment 11 Cole Robinson 2022-01-14 17:26:40 UTC
The failure is arguable correct, the rom setting has no effect for address type='unassigned', since that device is not passed to qemu in any way. Maybe the error message could be more specific but IMO this is realllly obscure error checking condition, we should just ignore it for RHEL, it's not worth the effort to track and fix and backport IMO

Comment 12 Yanqiu Zhang 2022-01-17 02:50:51 UTC
(In reply to Cole Robinson from comment #11)
> The failure is arguable correct, the rom setting has no effect for address
> type='unassigned', since that device is not passed to qemu in any way. Maybe
> the error message could be more specific but IMO this is realllly obscure
> error checking condition, we should just ignore it for RHEL, it's not worth
> the effort to track and fix and backport IMO

Hi. Thanks Cole,
But my concern is in comment6, about "starting and hotplugging 'unassigned' hostdev have different behaviors", nothing about rom. I'll cc you in another tracking bug.
But with your reply, I guess rom setting should not be allowed for 'unassigned' address type device, right? This bug's fix permits hotplug for it. Do you think it should be prohibited back or sth? (comment5's error is just my reproduce, now hotplug succeeds.)

Comment 13 Cole Robinson 2022-01-17 15:43:24 UTC
I commented on the other bug.

rom setting does not have any effect for type='unassigned' but it's very minor impact, I don't think it's worth tracking and fixing for RHEL

Comment 14 Yanqiu Zhang 2022-01-18 03:03:32 UTC
(In reply to Cole Robinson from comment #13)

Ok. Thank you so much!

Comment 16 errata-xmlrpc 2022-05-17 12:45:49 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 (new packages: libvirt), 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/RHBA-2022:2390


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