[PATCH 1/6] domain: Add PCI configuration feature infrastructure

Matthew R. Ochs via Devel posted 6 patches 1 week, 4 days ago
There is a newer version of this series
[PATCH 1/6] domain: Add PCI configuration feature infrastructure
Posted by Matthew R. Ochs via Devel 1 week, 4 days ago
Add basic infrastructure for PCI configuration feature including:
- New PCI configuration structure in domain_conf.h
- Add VIR_DOMAIN_FEATURE_PCI enum and string conversion
- Add pci field to virDomainDef to store PCI configuration

This will be used to support QEMU's highmem-mmio-size machine property
for the aarch64 virt machine type.

Signed-off-by: Matthew R. Ochs <mochs@nvidia.com>
---
 src/conf/domain_conf.c | 2 ++
 src/conf/domain_conf.h | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 87f87bbe56b2..acc30ffca765 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -187,6 +187,7 @@ VIR_ENUM_IMPL(virDomainFeature,
               "ras",
               "ps2",
               "aia",
+              "pci",
 );
 
 VIR_ENUM_IMPL(virDomainCapabilitiesPolicy,
@@ -4061,6 +4062,7 @@ void virDomainDefFree(virDomainDef *def)
     g_free(def->kvm_features);
     g_free(def->hyperv_vendor_id);
     g_free(def->tcg_features);
+    g_free(def->pci);
 
     virBlkioDeviceArrayClear(def->blkio.devices,
                              def->blkio.ndevices);
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index e51c74b6d18e..5dc7379655df 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2207,6 +2207,7 @@ typedef enum {
     VIR_DOMAIN_FEATURE_RAS,
     VIR_DOMAIN_FEATURE_PS2,
     VIR_DOMAIN_FEATURE_AIA,
+    VIR_DOMAIN_FEATURE_PCI,
 
     VIR_DOMAIN_FEATURE_LAST
 } virDomainFeature;
@@ -3039,6 +3040,10 @@ struct _virDomainPstoreDef {
     virDomainDeviceInfo info;
 };
 
+typedef struct _virDomainPCIDef {
+    unsigned long long highmemMMIOSize;  /* in bytes */
+} virDomainPCIDef;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainPCIDef, virObjectUnref);
 
 #define SCSI_SUPER_WIDE_BUS_MAX_CONT_UNIT 64
 #define SCSI_WIDE_BUS_MAX_CONT_UNIT 16
@@ -3100,6 +3105,7 @@ struct _virDomainDef {
     virDomainPerfDef perf;
 
     virDomainOSDef os;
+    virDomainPCIDef *pci;
     char *emulator;
     /* Most {caps_,hyperv_,kvm_,}feature options utilize a virTristateSwitch
      * to handle support. A few assign specific data values to the option.
-- 
2.46.0