Fix pci-irq-affinity-agent xml parsing

Bug #1945201 reported by Lucas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
High
Lucas

Bug Description

Brief Description
-----------------

The pci-irq-affinity-agent breaks when at least one interface driver name of an OpenStack instance `vfio`, the agent looks the interface inside a XML file. This is an agent requirement, but it shouldn't break the module. Other XML parsing also fails.

Severity
--------
Critical

Steps to Reproduce
------------------
Create an OpenStack instance (cpu_policy=dedicated) without a interface that uses `vfio` as driver. Check into `platform.log` for the error: Failed to access libvirt!

Expected Behavior
------------------
The agent checks all drivers and doesn't break if the required driver name doesn't exist.

Actual Behavior
----------------
In the first driver name that not starts with `vfio` the agent stops with the error: WARNING Failed to access libvirt! error='NoneType' object has no attribute 'get'

Reproducibility
---------------
Reproducible

System Configuration
--------------------
all

Branch/Pull Time/Commit
-----------------------
master

Test Activity
-------------
Feature Testing

Workaround
----------
N/A

Lucas (lcavalca)
summary: - Increase pci-irq-affinity-agent logs
+ Fix pci-irq-affinity-agent xml parsing
Lucas (lcavalca)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to utilities (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/utilities/+/811131

Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/utilities/+/811986

Ghada Khalil (gkhalil)
tags: added: stx.distro.openstack
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to utilities (master)

Reviewed: https://review.opendev.org/c/starlingx/utilities/+/811986
Committed: https://opendev.org/starlingx/utilities/commit/2a0144af671226cacc6be277344db9b8ca46b854
Submitter: "Zuul (22348)"
Branch: master

commit 2a0144af671226cacc6be277344db9b8ca46b854
Author: Lucas Cavalcante <email address hidden>
Date: Thu Sep 30 11:50:54 2021 -0300

    Fix pci-irq-affinity-agent xml parser (devices)

    There is an issue in the agent's parser when it tries to parse domxml from instances
    that have multiple 'device/interface'. It tries to get the driver.name from
    all interfaces, including the ones without driver.name, e.g.:

    <interface type='vhostuser'>
      <mac address='aa:bb:cc:00:11:22'/>
      <source type='unix' path='/var/run/vswitch/0000000' mode='client'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

    This breaks the code:

    WARNING Failed to access libvirt! error='NoneType' object has no attribute 'get'

    Furthermore, for some network cards and/or older versions of libvirt, the software
    creates devices at 'device/hostdev'.

    This patch implements a way to find the device's driver and checks for its name.

    Test Plan:

    PASS: In a AIO-SX using The Intel® Ethernet Controller 10 Gigabit 82599EB,
    which supports 32 VFs per port with only SR-IOV configured with only SR-IOV
    configured.

    PASS: In a Standard using The Intel® Ethernet Controller 10 Gigabit 82599EB,
    which supports 32 VFs per port with only SR-IOV configured with SR-IOV and
    PCI Passthrough configured.

    Signed-off-by: hbrito <email address hidden>
    Signed-off-by: Lucas Cavalcante <email address hidden>
    Partial-bug: 1945201
    Change-Id: Ia486ab61286c2474878856ae5e7bce0216e618d0

Changed in starlingx:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.opendev.org/c/starlingx/utilities/+/811131
Committed: https://opendev.org/starlingx/utilities/commit/8838bed45accab5b80838ee7f631a28c7c608e12
Submitter: "Zuul (22348)"
Branch: master

commit 8838bed45accab5b80838ee7f631a28c7c608e12
Author: Lucas Cavalcante <email address hidden>
Date: Mon Sep 27 10:35:29 2021 -0300

    Increase log messages for pci-irq-affinity-agent

    The pci-irq-affinity-agent does not give the user/admin useful information
    about the steps that the agent is running. It is necessary to add INFO
    and DEBUG logs to identify possible failures.

    Signed-off-by: Lucas Cavalcante <email address hidden>
    Closes-bug: 1945201
    Depends-on: Ia486ab61286c2474878856ae5e7bce0216e618d0
    Change-Id: If09c6ede3dd2d7fc49f14940d8ff902085ee3902

Ghada Khalil (gkhalil)
tags: added: stx.6.0
Changed in starlingx:
assignee: nobody → Lucas (lcavalca)
importance: Undecided → High
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.