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 = {
|
virFileCacheHandlers qemuCapsCacheHandlers = {
|
||||||
.isValid = virQEMUCapsIsValid,
|
.isValid = virQEMUCapsIsValid,
|
||||||
.newData = virQEMUCapsNewData,
|
.newData = virQEMUCapsNewData,
|
||||||
@ -5925,9 +5889,7 @@ virQEMUCapsCacheLookup(virFileCache *cache,
|
|||||||
|
|
||||||
virQEMUCaps *
|
virQEMUCaps *
|
||||||
virQEMUCapsCacheLookupCopy(virFileCache *cache,
|
virQEMUCapsCacheLookupCopy(virFileCache *cache,
|
||||||
virDomainVirtType virtType,
|
const char *binary)
|
||||||
const char *binary,
|
|
||||||
const char *machineType)
|
|
||||||
{
|
{
|
||||||
virQEMUCaps *qemuCaps = virQEMUCapsCacheLookup(cache, binary);
|
virQEMUCaps *qemuCaps = virQEMUCapsCacheLookup(cache, binary);
|
||||||
virQEMUCaps *ret;
|
virQEMUCaps *ret;
|
||||||
@ -5938,7 +5900,6 @@ virQEMUCapsCacheLookupCopy(virFileCache *cache,
|
|||||||
ret = virQEMUCapsNewCopy(qemuCaps);
|
ret = virQEMUCapsNewCopy(qemuCaps);
|
||||||
virObjectUnref(qemuCaps);
|
virObjectUnref(qemuCaps);
|
||||||
|
|
||||||
virQEMUCapsFilterByMachineType(ret, virtType, machineType);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -783,9 +783,6 @@ const char *virQEMUCapsGetMachineDefaultRAMid(virQEMUCaps *qemuCaps,
|
|||||||
virDomainVirtType virtType,
|
virDomainVirtType virtType,
|
||||||
const char *name);
|
const char *name);
|
||||||
|
|
||||||
void virQEMUCapsFilterByMachineType(virQEMUCaps *qemuCaps,
|
|
||||||
virDomainVirtType virtType,
|
|
||||||
const char *machineType);
|
|
||||||
char * virQEMUCapsGetDefaultEmulator(virArch hostarch,
|
char * virQEMUCapsGetDefaultEmulator(virArch hostarch,
|
||||||
virArch guestarch);
|
virArch guestarch);
|
||||||
|
|
||||||
@ -796,9 +793,7 @@ virFileCache *virQEMUCapsCacheNew(const char *libDir,
|
|||||||
virQEMUCaps *virQEMUCapsCacheLookup(virFileCache *cache,
|
virQEMUCaps *virQEMUCapsCacheLookup(virFileCache *cache,
|
||||||
const char *binary);
|
const char *binary);
|
||||||
virQEMUCaps *virQEMUCapsCacheLookupCopy(virFileCache *cache,
|
virQEMUCaps *virQEMUCapsCacheLookupCopy(virFileCache *cache,
|
||||||
virDomainVirtType virtType,
|
const char *binary);
|
||||||
const char *binary,
|
|
||||||
const char *machineType);
|
|
||||||
virQEMUCaps *virQEMUCapsCacheLookupDefault(virFileCache *cache,
|
virQEMUCaps *virQEMUCapsCacheLookupDefault(virFileCache *cache,
|
||||||
const char *binary,
|
const char *binary,
|
||||||
const char *archStr,
|
const char *archStr,
|
||||||
|
@ -6612,9 +6612,7 @@ qemuDomainDefFormatBufInternal(virQEMUDriver *driver,
|
|||||||
qCaps = virObjectRef(qemuCaps);
|
qCaps = virObjectRef(qemuCaps);
|
||||||
} else {
|
} else {
|
||||||
if (!(qCaps = virQEMUCapsCacheLookupCopy(driver->qemuCapsCache,
|
if (!(qCaps = virQEMUCapsCacheLookupCopy(driver->qemuCapsCache,
|
||||||
def->virtType,
|
def->emulator)))
|
||||||
def->emulator,
|
|
||||||
def->os.machine)))
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5652,9 +5652,7 @@ qemuProcessPrepareQEMUCaps(virDomainObj *vm,
|
|||||||
|
|
||||||
virObjectUnref(priv->qemuCaps);
|
virObjectUnref(priv->qemuCaps);
|
||||||
if (!(priv->qemuCaps = virQEMUCapsCacheLookupCopy(qemuCapsCache,
|
if (!(priv->qemuCaps = virQEMUCapsCacheLookupCopy(qemuCapsCache,
|
||||||
vm->def->virtType,
|
vm->def->emulator)))
|
||||||
vm->def->emulator,
|
|
||||||
vm->def->os.machine)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* Update qemu capabilities according to lists passed in via namespace */
|
/* Update qemu capabilities according to lists passed in via namespace */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user