[libvirt] [PATCH 00/15] Nodedev-mdev overhaul

Erik Skultety eskultet at redhat.com
Thu Jan 25 09:23:47 UTC 2018

        - contained a decent amount of redundant code handling the same thing,
          now it doesn't.
        - only updated dynamic capabilities during dumpXML, now it does every
          time it touches them
        - didn't update mdev capabilities at all, now it does

This series combines some long-needed refactor changes to the nodedev driver
with some necessary mdev fixes based on Wu Zongyong's patch series [1].
There's a lot of simple code movement due to the fact that update of the device
capabilities is strictly bound to the nodedev driver. The problem with the
existing approach is that in order to properly update all capabilities,
especially mdev, we would have to violate the logical code flow we have and
call back into the driver to have access to sysfs, i.e. driver->(conf|obj)
handling->util_helpers->DRIVER. Therefore to resolve it, along with all the
compilation dependencies, I moved most of the capability handling out of the
driver into src/conf/node_device_conf.c which already contained more than just
parsing and formatting of the capabilities. I also had to move the existing
virNodeDevCapMdevType into src/util so that the util helpers would know the
type they're working with.

[1] https://www.redhat.com/archives/libvir-list/2018-January/msg00315.html

Erik Skultety (15):
  conf: nodedev: Rename virNodeDevObjHasCap to virNodeDevObjHasCapStr
  conf: nodedev: Rename virNodeDeviceCapMatch to virNodeDevObjHasCap
  conf: nodedev: Convert virNodeDevObjHasCapStr to a simple wrapper
  nodedev: Drop the nodeDeviceSysfsGetSCSIHostCaps wrapper
  nodedev: Move the sysfs-related cap handling to node_device_conf.c
  nodedev: Export nodeDeviceUpdateCaps from node_device_conf.c
  nodedev: Introduce virNodeDeviceCapsListExport
  conf: nodedev: Refresh capabilities before touching them
  util: mdev: Drop some unused symbols/includes from the header
  util: mdev: Introduce virMediatedDeviceType structure
  util: mdev: Introduce virMediatedDeviceTypeReadAttrs getter
  util: pci: Introduce virPCIGetMdevTypes helper
  nodedev: udev: Drop the unused mdev type helpers
  conf: Replace usage of virNodeDevCapMdevType with
  conf: nodedev: Update PCI mdev capabilities dynamically

 src/Makefile.am                           |   4 +-
 src/conf/node_device_conf.c               | 343 ++++++++++++++++++++++++++++--
 src/conf/node_device_conf.h               |  29 +--
 src/conf/virnodedeviceobj.c               |  74 ++-----
 src/libvirt_private.syms                  |   7 +-
 src/node_device/node_device_driver.c      | 130 ++---------
 src/node_device/node_device_hal.c         |   5 +-
 src/node_device/node_device_linux_sysfs.c | 218 -------------------
 src/node_device/node_device_linux_sysfs.h |  34 ---
 src/node_device/node_device_udev.c        | 127 +----------
 src/util/virmdev.c                        |  47 ++++
 src/util/virmdev.h                        |  20 +-
 src/util/virpci.c                         |  58 +++++
 src/util/virpci.h                         |   4 +
 14 files changed, 516 insertions(+), 584 deletions(-)
 delete mode 100644 src/node_device/node_device_linux_sysfs.c
 delete mode 100644 src/node_device/node_device_linux_sysfs.h


More information about the libvir-list mailing list