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.
patch 1/11: pci/usb/scsi used_by should include driver and domain info to check
conflict among different drivers.
patch 2/11~5/11: extract qemu specific code outside, to prepare for hostdev
common library
patch 6/11: move hostdev functions from qemu_hostdev.c to common library and
maintain insistent device state.
patch 7/11: add a unit test for hostdev common library.
patch 8/11: switch qemu driver to use the common library instead of its own
hostdev passthrough APIs.
patch 9/11: switch lxc driver to use the common library instead of its own
hostdev passthrough APIs.
patch 10/11: add a hostdev pci backend type for xen usage.
patch 11/11: add pci passthrough to libxl driver.
---
Changes to v11:
* rebase to latest shareable scsi hostdev changes
* split v11 1/6 (add hostdev common library): add some small patches to extract qemu
specific codes outside first before adding hostdev common library patch, for easier
review.
Chunyan Liu (11):
change used_by: specify both driver and domain
qemu_hostdev: move cfg->relaxedACS as a flag
qemu_hostdev: move COLD_BOOT as a flag
qemu_hostdev: parse BACKEND_DEFAULT outside
qemu_hostdev: add/remove share device outside
add hostdev passthrough common library
add unit test for hostdev common library
change qemu driver to use hostdev common library
change lxc driver to use hostdev common library
add hostdev pci backend type for xen
add pci passthrough for libxl driver
.gitignore | 1 +
docs/schemas/domaincommon.rng | 1 +
po/POTFILES.in | 3 +-
src/Makefile.am | 3 +-
src/conf/domain_conf.c | 3 +-
src/conf/domain_conf.h | 1 +
src/libvirt_private.syms | 21 +
src/libxl/libxl_conf.c | 63 +
src/libxl/libxl_conf.h | 4 +
src/libxl/libxl_domain.c | 9 +
src/libxl/libxl_driver.c | 448 +++++-
src/lxc/lxc_conf.h | 4 -
src/lxc/lxc_driver.c | 47 +-
src/lxc/lxc_hostdev.c | 413 -----
src/lxc/lxc_hostdev.h | 43 -
src/lxc/lxc_process.c | 24 +-
src/qemu/qemu_command.c | 4 +-
src/qemu/qemu_conf.h | 11 +-
src/qemu/qemu_domain.c | 22 +
src/qemu/qemu_driver.c | 83 +-
src/qemu/qemu_hostdev.c | 89 +-
src/qemu/qemu_hostdev.h | 5 +-
src/qemu/qemu_hotplug.c | 144 +-
src/qemu/qemu_process.c | 61 +-
src/util/virhostdev.c | 1787 ++++++++++++++++++++
src/util/virhostdev.h | 134 ++
src/util/virpci.c | 30 +-
src/util/virpci.h | 9 +-
src/util/virscsi.c | 30 +-
src/util/virscsi.h | 7 +-
src/util/virusb.c | 29 +-
src/util/virusb.h | 8 +-
tests/Makefile.am | 5 +
.../qemuxml2argv-hostdev-pci-address.xml | 1 +
.../qemuxml2argvdata/qemuxml2argv-net-hostdev.xml | 1 +
tests/qemuxml2argvdata/qemuxml2argv-pci-rom.xml | 2 +
tests/virhostdevtest.c | 473 ++++++
tests/virscsitest.c | 6 +-
38 files changed, 3292 insertions(+), 737 deletions(-)
delete mode 100644 src/lxc/lxc_hostdev.c
delete mode 100644 src/lxc/lxc_hostdev.h
create mode 100644 src/util/virhostdev.c
create mode 100644 src/util/virhostdev.h
create mode 100644 tests/virhostdevtest.c