diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 94c651befbe213b6a1673c878fe5af80e397f4c9..e17696fbc657477a906a77b0b556da1318d9ed1d 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -20,6 +20,7 @@ #include +#include "device_conf.h" #include "domain_capabilities.h" #include "domain_conf.h" #include "viralloc.h" @@ -660,3 +661,42 @@ virDomainCapsFormat(virDomainCapsPtr const caps) virBufferCheckError(&buf); return virBufferContentAndReset(&buf); } + + +int +virDomainCapsDeviceDefValidate(virDomainCapsPtr const caps ATTRIBUTE_UNUSED, + const virDomainDeviceDef *dev, + const virDomainDef *def ATTRIBUTE_UNUSED) +{ + switch ((virDomainDeviceType) dev->type) { + case VIR_DOMAIN_DEVICE_DISK: + case VIR_DOMAIN_DEVICE_REDIRDEV: + case VIR_DOMAIN_DEVICE_NET: + case VIR_DOMAIN_DEVICE_CONTROLLER: + case VIR_DOMAIN_DEVICE_CHR: + case VIR_DOMAIN_DEVICE_SMARTCARD: + case VIR_DOMAIN_DEVICE_RNG: + case VIR_DOMAIN_DEVICE_HOSTDEV: + case VIR_DOMAIN_DEVICE_VIDEO: + case VIR_DOMAIN_DEVICE_MEMORY: + case VIR_DOMAIN_DEVICE_VSOCK: + case VIR_DOMAIN_DEVICE_INPUT: + case VIR_DOMAIN_DEVICE_SHMEM: + case VIR_DOMAIN_DEVICE_LEASE: + case VIR_DOMAIN_DEVICE_FS: + case VIR_DOMAIN_DEVICE_SOUND: + case VIR_DOMAIN_DEVICE_WATCHDOG: + case VIR_DOMAIN_DEVICE_GRAPHICS: + case VIR_DOMAIN_DEVICE_HUB: + case VIR_DOMAIN_DEVICE_MEMBALLOON: + case VIR_DOMAIN_DEVICE_NVRAM: + case VIR_DOMAIN_DEVICE_TPM: + case VIR_DOMAIN_DEVICE_PANIC: + case VIR_DOMAIN_DEVICE_IOMMU: + case VIR_DOMAIN_DEVICE_NONE: + case VIR_DOMAIN_DEVICE_LAST: + break; + } + + return 0; +} diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index e0302a0649f1f9ea1b601638eb9b5f8527212388..4ff394608ee0d8febfd84505eb88deb27dc4b7ee 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -225,6 +225,10 @@ void virDomainCapsEnumClear(virDomainCapsEnumPtr capsEnum); char * virDomainCapsFormat(virDomainCapsPtr const caps); +int virDomainCapsDeviceDefValidate(virDomainCapsPtr const caps, + const virDomainDeviceDef *dev, + const virDomainDef *def); + void virSEVCapabilitiesFree(virSEVCapability *capabilities); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 42779ddc8ce4e600e566947bac6f2e48d93d2e7d..156add9f359086aec566f9ced5e23c268ae9b6ed 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -197,6 +197,7 @@ virDomainCapsCPUModelsGet; virDomainCapsCPUModelsNew; virDomainCapsCPUUsableTypeFromString; virDomainCapsCPUUsableTypeToString; +virDomainCapsDeviceDefValidate; virDomainCapsEnumClear; virDomainCapsEnumSet; virDomainCapsFormat;