[PATCH 3/5] conf: Drop virDomainCapsDeviceDefValidate()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/conf/domain_capabilities.c | 55 ----------------------------------
 src/conf/domain_capabilities.h |  4 ---
 src/libvirt_private.syms       |  1 -
 src/qemu/qemu_validate.c       | 10 -------
 4 files changed, 70 deletions(-)

diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c
index 0e0e6d1600..8a690a57a3 100644
--- a/src/conf/domain_capabilities.c
+++ b/src/conf/domain_capabilities.c
@@ -628,58 +628,3 @@ virDomainCapsFormat(const virDomainCaps *caps)
 
     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;
-}
diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h
index 685d5e2a44..4ae6f0fbb1 100644
--- a/src/conf/domain_capabilities.h
+++ b/src/conf/domain_capabilities.h
@@ -232,10 +232,6 @@ void virDomainCapsEnumClear(virDomainCapsEnumPtr capsEnum);
 
 char * virDomainCapsFormat(const virDomainCaps *caps);
 
-int virDomainCapsDeviceDefValidate(const virDomainCaps *caps,
-                                   const virDomainDeviceDef *dev,
-                                   const virDomainDef *def);
-
 void
 virSEVCapabilitiesFree(virSEVCapability *capabilities);
 
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 491bd5bd87..1d98f01334 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -212,7 +212,6 @@ virDomainCapsCPUModelsGet;
 virDomainCapsCPUModelsNew;
 virDomainCapsCPUUsableTypeFromString;
 virDomainCapsCPUUsableTypeToString;
-virDomainCapsDeviceDefValidate;
 virDomainCapsEnumClear;
 virDomainCapsEnumSet;
 virDomainCapsFormat;
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index 4defdb02cf..09cdcb20c2 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -4682,24 +4682,14 @@ qemuValidateDomainDeviceDef(const virDomainDeviceDef *dev,
     int ret = 0;
     virQEMUDriverPtr driver = opaque;
     g_autoptr(virQEMUCaps) qemuCaps = NULL;
-    g_autoptr(virDomainCaps) domCaps = NULL;
 
     if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache,
                                             def->emulator)))
         return -1;
 
-    if (!(domCaps = virQEMUDriverGetDomainCapabilities(driver, qemuCaps,
-                                                       def->os.machine,
-                                                       def->os.arch,
-                                                       def->virtType)))
-        return -1;
-
     if ((ret = qemuValidateDomainDeviceDefAddress(dev, qemuCaps)) < 0)
         return ret;
 
-    if ((ret = virDomainCapsDeviceDefValidate(domCaps, dev, def)) < 0)
-        return ret;
-
     switch ((virDomainDeviceType)dev->type) {
     case VIR_DOMAIN_DEVICE_NET:
         ret = qemuValidateDomainDeviceDefNetwork(dev->data.net, qemuCaps);
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux