mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 04:55:18 +00:00
qemu: capabilities: Remove unused 'virQEMUCapsFilterByMachineType'
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@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
d0601b4267
commit
24b769a25b
@ -5820,42 +5820,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,
|
||||
@ -5925,9 +5889,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;
|
||||
@ -5938,7 +5900,6 @@ virQEMUCapsCacheLookupCopy(virFileCache *cache,
|
||||
ret = virQEMUCapsNewCopy(qemuCaps);
|
||||
virObjectUnref(qemuCaps);
|
||||
|
||||
virQEMUCapsFilterByMachineType(ret, virtType, machineType);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
@ -6612,9 +6612,7 @@ qemuDomainDefFormatBufInternal(virQEMUDriver *driver,
|
||||
qCaps = virObjectRef(qemuCaps);
|
||||
} else {
|
||||
if (!(qCaps = virQEMUCapsCacheLookupCopy(driver->qemuCapsCache,
|
||||
def->virtType,
|
||||
def->emulator,
|
||||
def->os.machine)))
|
||||
def->emulator)))
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -5652,9 +5652,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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user