The first attempt to share PCI allocation code from qemu driver with bhyve.
To this point it went pretty smooth and I didn't have to make any changes
to the implementation of the extracted PCI code.
The only slight change I made is extracing virDomainPCIAddressSetAlloc()
from DomainPCIAddressSetCreate() to perform the actual memory allocation, just
because having virDomainPCIAddressSetFree() without Alloc() felt a little
inconsistent.
During testing I spotted only one problem (so far): the domain defined on
libvirtd without new PCI allocation doesn't start on a new version because
the definition didn't have addresses auto-assigned.
Also, I guess, there could be cases where bhyve code will trigger something from
PCI allocation code that is not supported by bhyve (e.g.: pci bridge). I'm not sure
how to properly test all the cases like that.
Changes from v2:
- Base on PCI allocation code from Qemu driver
Changes from v1:
- Reserve slot 1 for LPC PCI-ISA bridge, used by console device
- Respect addresses provided by user in domain xml file
- Fix tests so 'make check' passes
Roman Bogorodskiy (3):
qemu: extract PCI handling structs
qemu: extract common PCI handling functions
bhyve: implement PCI address allocation
Roman Bogorodskiy (3):
qemu: extract PCI handling structs
qemu: extract common PCI handling functions
bhyve: implement PCI address allocation
po/POTFILES.in | 1 +
src/Makefile.am | 6 +-
src/bhyve/bhyve_command.c | 131 ++--
src/bhyve/bhyve_device.c | 174 +++++
src/bhyve/bhyve_device.h | 38 ++
src/bhyve/bhyve_domain.c | 75 +++
src/bhyve/bhyve_domain.h | 39 ++
src/bhyve/bhyve_driver.c | 9 +-
src/libvirt_private.syms | 14 +
src/qemu/qemu_command.c | 749 +++------------------
src/qemu/qemu_command.h | 40 +-
src/qemu/qemu_domain.c | 2 +-
src/qemu/qemu_domain.h | 5 +-
src/qemu/qemu_hotplug.c | 8 +-
src/qemu/qemu_process.c | 2 +-
src/util/virpci.c | 532 +++++++++++++++
src/util/virpci.h | 121 ++++
.../bhyvexml2argvdata/bhyvexml2argv-acpiapic.args | 2 +-
tests/bhyvexml2argvdata/bhyvexml2argv-acpiapic.xml | 2 +
tests/bhyvexml2argvdata/bhyvexml2argv-base.args | 2 +-
tests/bhyvexml2argvdata/bhyvexml2argv-base.xml | 2 +
tests/bhyvexml2argvdata/bhyvexml2argv-console.args | 4 +-
tests/bhyvexml2argvdata/bhyvexml2argv-console.xml | 2 +
.../bhyvexml2argv-disk-virtio.args | 2 +-
.../bhyvexml2argv-disk-virtio.xml | 2 +
tests/bhyvexml2argvdata/bhyvexml2argv-macaddr.args | 2 +-
tests/bhyvexml2argvdata/bhyvexml2argv-macaddr.xml | 2 +
tests/bhyvexml2argvdata/bhyvexml2argv-serial.args | 4 +-
tests/bhyvexml2argvdata/bhyvexml2argv-serial.xml | 2 +
tools/Makefile.am | 1 +
30 files changed, 1205 insertions(+), 770 deletions(-)
create mode 100644 src/bhyve/bhyve_device.c
create mode 100644 src/bhyve/bhyve_device.h
create mode 100644 src/bhyve/bhyve_domain.c
create mode 100644 src/bhyve/bhyve_domain.h
--
1.9.0