conf: Drop virDomainCapsDeviceDefValidate()

Now that nothing uses virDomainCapsDeviceDefValidate() it can be
removed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
Michal Privoznik 2020-11-13 20:46:58 +01:00
parent a33279daa8
commit 4b487e1052
4 changed files with 0 additions and 70 deletions

View File

@ -628,58 +628,3 @@ virDomainCapsFormat(const virDomainCaps *caps)
return virBufferContentAndReset(&buf); return virBufferContentAndReset(&buf);
} }
#define ENUM_VALUE_MISSING(capsEnum, value) !(capsEnum.values & (1 << value))
#define ENUM_VALUE_ERROR(valueLabel, valueString) \
do { \
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, \
_("domain configuration does not support '%s' value '%s'"), \
valueLabel, valueString); \
} while (0)
int
virDomainCapsDeviceDefValidate(const virDomainCaps *caps G_GNUC_UNUSED,
const virDomainDeviceDef *dev,
const virDomainDef *def G_GNUC_UNUSED)
{
int ret = 0;
switch ((virDomainDeviceType) dev->type) {
case VIR_DOMAIN_DEVICE_VIDEO:
case VIR_DOMAIN_DEVICE_AUDIO:
/* TODO: add validation */
break;
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_HOSTDEV:
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_RNG:
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 ret;
}

View File

@ -232,10 +232,6 @@ void virDomainCapsEnumClear(virDomainCapsEnumPtr capsEnum);
char * virDomainCapsFormat(const virDomainCaps *caps); char * virDomainCapsFormat(const virDomainCaps *caps);
int virDomainCapsDeviceDefValidate(const virDomainCaps *caps,
const virDomainDeviceDef *dev,
const virDomainDef *def);
void void
virSEVCapabilitiesFree(virSEVCapability *capabilities); virSEVCapabilitiesFree(virSEVCapability *capabilities);

View File

@ -212,7 +212,6 @@ virDomainCapsCPUModelsGet;
virDomainCapsCPUModelsNew; virDomainCapsCPUModelsNew;
virDomainCapsCPUUsableTypeFromString; virDomainCapsCPUUsableTypeFromString;
virDomainCapsCPUUsableTypeToString; virDomainCapsCPUUsableTypeToString;
virDomainCapsDeviceDefValidate;
virDomainCapsEnumClear; virDomainCapsEnumClear;
virDomainCapsEnumSet; virDomainCapsEnumSet;
virDomainCapsFormat; virDomainCapsFormat;

View File

@ -4682,24 +4682,14 @@ qemuValidateDomainDeviceDef(const virDomainDeviceDef *dev,
int ret = 0; int ret = 0;
virQEMUDriverPtr driver = opaque; virQEMUDriverPtr driver = opaque;
g_autoptr(virQEMUCaps) qemuCaps = NULL; g_autoptr(virQEMUCaps) qemuCaps = NULL;
g_autoptr(virDomainCaps) domCaps = NULL;
if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache, if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache,
def->emulator))) def->emulator)))
return -1; return -1;
if (!(domCaps = virQEMUDriverGetDomainCapabilities(driver, qemuCaps,
def->os.machine,
def->os.arch,
def->virtType)))
return -1;
if ((ret = qemuValidateDomainDeviceDefAddress(dev, qemuCaps)) < 0) if ((ret = qemuValidateDomainDeviceDefAddress(dev, qemuCaps)) < 0)
return ret; return ret;
if ((ret = virDomainCapsDeviceDefValidate(domCaps, dev, def)) < 0)
return ret;
switch ((virDomainDeviceType)dev->type) { switch ((virDomainDeviceType)dev->type) {
case VIR_DOMAIN_DEVICE_NET: case VIR_DOMAIN_DEVICE_NET:
ret = qemuValidateDomainDeviceDefNetwork(dev->data.net, qemuCaps); ret = qemuValidateDomainDeviceDefNetwork(dev->data.net, qemuCaps);