The filtering of qemu capabilities by machine type doesn't seem to be ever used, remove it and adjust callers. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/qemu/qemu_capabilities.c | 41 +----------------------------------- src/qemu/qemu_capabilities.h | 7 +----- src/qemu/qemu_domain.c | 4 +--- src/qemu/qemu_process.c | 4 +--- 4 files changed, 4 insertions(+), 52 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 0538acd05d..751702649f 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5836,42 +5836,6 @@ virQEMUCapsLoadFile(const char *filename, } -struct virQEMUCapsMachineTypeFilter { - const char *machineType; - virQEMUCapsFlags *flags; - size_t nflags; -}; - -static const struct virQEMUCapsMachineTypeFilter virQEMUCapsMachineFilter[] = { - /* { "blah", virQEMUCapsMachineBLAHFilter, - G_N_ELEMENTS(virQEMUCapsMachineBLAHFilter) }, */ - { "", NULL, 0 }, -}; - - -void -virQEMUCapsFilterByMachineType(virQEMUCaps *qemuCaps, - virDomainVirtType virtType G_GNUC_UNUSED, - const char *machineType) -{ - size_t i; - - if (!machineType) - return; - - for (i = 0; i < G_N_ELEMENTS(virQEMUCapsMachineFilter); i++) { - const struct virQEMUCapsMachineTypeFilter *filter = &virQEMUCapsMachineFilter[i]; - size_t j; - - if (STRNEQ(filter->machineType, machineType)) - continue; - - for (j = 0; j < filter->nflags; j++) - virQEMUCapsClear(qemuCaps, filter->flags[j]); - } -} - - virFileCacheHandlers qemuCapsCacheHandlers = { .isValid = virQEMUCapsIsValid, .newData = virQEMUCapsNewData, @@ -5941,9 +5905,7 @@ virQEMUCapsCacheLookup(virFileCache *cache, virQEMUCaps * virQEMUCapsCacheLookupCopy(virFileCache *cache, - virDomainVirtType virtType, - const char *binary, - const char *machineType) + const char *binary) { virQEMUCaps *qemuCaps = virQEMUCapsCacheLookup(cache, binary); virQEMUCaps *ret; @@ -5954,7 +5916,6 @@ virQEMUCapsCacheLookupCopy(virFileCache *cache, ret = virQEMUCapsNewCopy(qemuCaps); virObjectUnref(qemuCaps); - virQEMUCapsFilterByMachineType(ret, virtType, machineType); return ret; } diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index d68a819442..ba289ba6b9 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -783,9 +783,6 @@ const char *virQEMUCapsGetMachineDefaultRAMid(virQEMUCaps *qemuCaps, virDomainVirtType virtType, const char *name); -void virQEMUCapsFilterByMachineType(virQEMUCaps *qemuCaps, - virDomainVirtType virtType, - const char *machineType); char * virQEMUCapsGetDefaultEmulator(virArch hostarch, virArch guestarch); @@ -796,9 +793,7 @@ virFileCache *virQEMUCapsCacheNew(const char *libDir, virQEMUCaps *virQEMUCapsCacheLookup(virFileCache *cache, const char *binary); virQEMUCaps *virQEMUCapsCacheLookupCopy(virFileCache *cache, - virDomainVirtType virtType, - const char *binary, - const char *machineType); + const char *binary); virQEMUCaps *virQEMUCapsCacheLookupDefault(virFileCache *cache, const char *binary, const char *archStr, diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 39ad97f1b1..3ef8ca33b6 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6622,9 +6622,7 @@ qemuDomainDefFormatBufInternal(virQEMUDriver *driver, qCaps = virObjectRef(qemuCaps); } else { if (!(qCaps = virQEMUCapsCacheLookupCopy(driver->qemuCapsCache, - def->virtType, - def->emulator, - def->os.machine))) + def->emulator))) return -1; } diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 3e1198a564..14d582e77f 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5659,9 +5659,7 @@ qemuProcessPrepareQEMUCaps(virDomainObj *vm, virObjectUnref(priv->qemuCaps); if (!(priv->qemuCaps = virQEMUCapsCacheLookupCopy(qemuCapsCache, - vm->def->virtType, - vm->def->emulator, - vm->def->os.machine))) + vm->def->emulator))) return -1; /* Update qemu capabilities according to lists passed in via namespace */ -- 2.41.0