[libvirt] [PATCH v13 00/49] write separate module for hostdev passthrough

Cedric Bosdonnat cbosdonnat at suse.com
Mon Mar 3 16:57:31 UTC 2014


Hello ChunYan,

I saw a few minor problems in some patches that made me rebase quite a
lot of other patches in your serie, but otherwise it really looks good
to me.

Here is a summary of the changes I made or questions I have:
    * Patch 2: Fixed a few remaining changes that broke the build.
      Just remember that having the tree building after each commit
      helps a lot when one later needs to bisect.
    * Patch 4: when is the manager freed?
    * Patch 5 & 6: remove the added ATTRIBUTE_UNUSED
    * Patch 9: added { } around if block to match else style.
    * Patch 10: remove added ATTRIBUTE_UNUSED
    * Patch 11: fixed indent function rename
    * Patch 42: Fix comment about qemuPrepareHostdevPCIDevices in
earlier patch
    * Patch 47: remove added ATTRIBUTE_UNUSED
    * Patch 49: Fixed the version in libxl_driver.c as 1.2.2 is out

The whole updated patch series is sitting here for those wanting to see
the changes applied:
https://github.com/cbosdo/libvirt/commits/hostdev-passthrough

Of course, I'ld love another pair of sharper eyes to look at the patch
series. I'm not an expert on the hostdev topic ;)

Kind regards
--
Cedric

On Sat, 2014-03-01 at 14:28 +0800, Chunyan Liu wrote:
> These patches implements a separate module for hostdev passthrough so that it
> could be shared by different drivers and can maintain a global state of a host
> device.
> 
> Patches 1~6 are to switch existing qemu and lxc driver to use common library
> lists, so that to maintain a global state of every host device.
> 
> Patches 7~45 are to extract general code from qemu_hostdev.c piece by piece,
> make them reusable common APIs.
> 
> Patches 46: unit test for the virhostdev common library
> Patches 47: add a hostdev backend type for xen
> Patches 48: add pci passthrough to libxl driver based on the common library
> Patches 49: change lxc to use common library APIs
> 
> ---
> changes to v12:
>   * split "add hostdev passthrough common library" patch into small patches
>     for easier review.
>   * fix v12 comments
>   * rebase to libxl changes
> 
> 
> Chunyan Liu (49):
>   add 'driver' info to used_by
>   qemu: reuse hostdev interfaces to avoid duplicate
>   qemu: remove functions now used internally only from qemu_hostdev.h
>   add virhostdev files to maintain global state of host devices
>   qemu: use general virhostdev lists instead of its own
>   lxc: use general virhostdev lists instead of its own
>   qemu_hostdev: move cfg->relaxedACS as a flag
>   qemu_hostdev: move ColdBoot as a flag
>   qemu_hostdev: move netconfig file location to virhostdev stateDir
>   extract general code from qemuPrepareHostdevPCIDevices
>   rename qemu*NetConfigRestore/Replace to
>     virHostdevNetConfigRestore/Replace
>   rename qemuGet*PciHostDeviceList to virHostdevGet*PciHostDeviceList
>   pass driver name as a parameter to virHostdevPrepareHostdevPCIDevices
>   extract general code from qemuDomainReAttachHostdevDevices
>   pass driver name as a parameter to virHostdevReAttachPCIDevices
>   rename qemuReAttachPciDevice to virHostdevReAttachPciDevice
>   move virHostdevPrepare(ReAttach)PCIDevices to virhostdev.c
>   extract general code from qemuUpdateActivePciHostdevs
>   extract general code from qemuUpdateActiveUsbHostdevs
>   extract general code from qemuUpdateActiveScsiHostdevs
>   pass driver_name as parameter of virHostdevUpdate*Hostdevs functions
>   move virHostdevUpdate* functions to virhostdev.c
>   qemuPrepareUSBDevices: code adjustment for extracting general code
>   extract general code from qemuPrepareHostUSBDevices
>   rename qemu*USBDevices to virHostdev*USBDevices
>   pass driver name to virHostdevPrepareUSBDevices
>   move virHostdevPrepareHostUSBDevices to virhostdev.c
>   extract general code from qemuPrepareHostSCSIDevices
>   pass driver name as parameter to virHostdevPrepareSCSIDevices
>   move virHostdevPrepareHostSCSIDevices to virhostdev.c
>   extract general code from qemuDomainReAttachHostUsbDevices
>   pass driver name as paramter to virHostdevReAttachUsbHostdevs
>   move virHostdevDomainReAttachHostUsbDevices to virhostdev.c
>   extract general code from qemuDomainReAttachHostScsiDevices
>   pass driver name as parameter to virHostdevReAttachScciHostdevs
>   move virHostdevReAttachHostScsiDevices to virhostdev.c
>   extract general code of NodeDeviceDetach
>   extract general code of NodeDeviceReAttach
>   extract general code of NodeDeviceReset
>   move virHostdevNodeDevice* to virhostdev.c
>   improve parameter name to let it more meaningful
>   rename some function names to keep consistency
>   improve virHostdevUpdate* parameters to make it more widely used
>   add 3 wrapper functions for prepare/reattach/update domain hostdevs
>   add parameter checks to common interfaces
>   add unit test for new virhostdev common library
>   change lxc_hostdev.c to use virhostdev common library APIs
>   add hostdev pci backend type for xen
>   add pci passthrough to libxl driver
> 
>  .gitignore                    |    1 +
>  docs/schemas/domaincommon.rng |    1 +
>  po/POTFILES.in                |    1 +
>  src/Makefile.am               |    1 +
>  src/conf/domain_conf.c        |    3 +-
>  src/conf/domain_conf.h        |    1 +
>  src/libvirt_private.syms      |   19 +
>  src/libxl/libxl_conf.c        |   63 ++
>  src/libxl/libxl_conf.h        |    4 +
>  src/libxl/libxl_domain.c      |    9 +
>  src/libxl/libxl_driver.c      |  447 +++++++++++-
>  src/lxc/lxc_conf.h            |    4 -
>  src/lxc/lxc_driver.c          |   17 +-
>  src/lxc/lxc_hostdev.c         |  315 +--------
>  src/qemu/qemu_command.c       |    3 +-
>  src/qemu/qemu_conf.h          |   10 +-
>  src/qemu/qemu_driver.c        |   88 +--
>  src/qemu/qemu_hostdev.c       | 1220 ++-----------------------------
>  src/qemu/qemu_hostdev.h       |   27 +-
>  src/qemu/qemu_hotplug.c       |   77 +--
>  src/qemu/qemu_process.c       |    8 +-
>  src/util/virhostdev.c         | 1621 +++++++++++++++++++++++++++++++++++++++++
>  src/util/virhostdev.h         |  140 ++++
>  src/util/virpci.c             |   31 +-
>  src/util/virpci.h             |    9 +-
>  src/util/virscsi.c            |   32 +-
>  src/util/virscsi.h            |    7 +-
>  src/util/virusb.c             |   31 +-
>  src/util/virusb.h             |    8 +-
>  tests/Makefile.am             |    5 +
>  tests/virhostdevtest.c        |  507 +++++++++++++
>  tests/virscsitest.c           |    6 +-
>  32 files changed, 3081 insertions(+), 1635 deletions(-)
>  create mode 100644 src/util/virhostdev.c
>  create mode 100644 src/util/virhostdev.h
>  create mode 100644 tests/virhostdevtest.c
> 
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
> 






More information about the libvir-list mailing list