mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Expose resource control capabilities for caches
Add cache resource control into capabilities for CAT without CDP:
<cache>
<bank id='0' level='3' type='unified' size='15360' unit='KiB' cpus='0-5'>
<control min='768' unit='KiB' scope='both' max_allocation='4'/>
</bank>
</cache>
and with CDP:
<cache>
<bank id='0' level='3' type='unified' size='15360' unit='KiB' cpus='0-5'>
<control min='768' unit='KiB' scope='code' max_allocation='4'/>
<control min='768' unit='KiB' scope='data' max_allocation='4'/>
</bank>
</cache>
Also add new test cases for vircaps2xmltest.
Signed-off-by: Eli Qiao <liyong.qiao@intel.com>
This commit is contained in:
committed by
Martin Kletzander
parent
7b4e9b2c55
commit
0ab409ccc4
@@ -47,6 +47,7 @@ test_virCapabilities(const void *opaque)
|
||||
char *capsXML = NULL;
|
||||
char *path = NULL;
|
||||
char *dir = NULL;
|
||||
char *resctrl = NULL;
|
||||
int ret = -1;
|
||||
|
||||
/*
|
||||
@@ -58,7 +59,12 @@ test_virCapabilities(const void *opaque)
|
||||
data->resctrl ? "/system" : "") < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (virAsprintf(&resctrl, "%s/vircaps2xmldata/linux-%s/resctrl",
|
||||
abs_srcdir, data->filename) < 0)
|
||||
goto cleanup;
|
||||
|
||||
virFileWrapperAddPrefix("/sys/devices/system", dir);
|
||||
virFileWrapperAddPrefix("/sys/fs/resctrl", resctrl);
|
||||
caps = virCapabilitiesNew(data->arch, data->offlineMigrate, data->liveMigrate);
|
||||
|
||||
if (!caps)
|
||||
@@ -84,6 +90,7 @@ test_virCapabilities(const void *opaque)
|
||||
|
||||
cleanup:
|
||||
VIR_FREE(dir);
|
||||
VIR_FREE(resctrl);
|
||||
VIR_FREE(path);
|
||||
VIR_FREE(capsXML);
|
||||
virObjectUnref(caps);
|
||||
@@ -112,6 +119,7 @@ mymain(void)
|
||||
DO_TEST("caches", VIR_ARCH_X86_64);
|
||||
|
||||
DO_TEST_FULL("resctrl", VIR_ARCH_X86_64, true, true, true);
|
||||
DO_TEST_FULL("resctrl-cdp", VIR_ARCH_X86_64, true, true, true);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user