build: make PCI (virtio and vfio) disableable at build time

Although included by default it is now possible to build without PCI
support.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2019-09-11 17:07:33 +01:00
parent 6d27ac9dfc
commit c042483953
8 changed files with 49 additions and 29 deletions

View File

@@ -12,6 +12,7 @@
extern crate epoll;
#[macro_use]
extern crate log;
#[cfg(feature = "pci_support")]
extern crate pci;
extern crate vhost_rs;
extern crate virtio_bindings;

View File

@@ -2,8 +2,11 @@
//
// SPDX-License-Identifier: Apache-2.0
#[cfg(feature = "pci_support")]
mod pci_common_config;
#[cfg(feature = "pci_support")]
mod pci_device;
#[cfg(feature = "pci_support")]
pub use pci_common_config::VirtioPciCommonConfig;
#[cfg(feature = "pci_support")]
pub use pci_device::VirtioPciDevice;

View File

@@ -7,6 +7,7 @@
// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause
extern crate devices;
#[cfg(feature = "pci_support")]
extern crate pci;
extern crate vm_allocator;
extern crate vm_memory;