+# util/virresctrl.h+virResCtrlAvailable;+virResCtrlInit;+This has nothing to do in the patch
# util/virrotatingfile.hvirRotatingFileReaderConsume;virRotatingFileReaderFree;@@ -2626,13 +2630,18 @@ virSysfsGetCpuValueString;virSysfsGetCpuValueUint;virSysfsGetNodeValueBitmap;virSysfsGetNodeValueString;+virSysfsGetResctrlInfoString;+virSysfsGetResctrlInfoUint;+virSysfsGetResctrlPath;+virSysfsGetResctrlString;+virSysfsGetResctrlUint;virSysfsGetSystemPath;virSysfsGetValueBitmap;virSysfsGetValueInt;virSysfsGetValueString;+virSysfsSetResctrlPath;virSysfsSetSystemPath;-Don't remove the line. Every time you are doing a change in the code(and I mean any code), try being consistent. If the code follows somestyle, don't fight it, but go with it. Not everything can be written inthe coding style. As you can see here, all files are separated by twolines. When you remove this, you make the file inconsistent.Also, I mentioned many times before that you should run make check andmake syntax-check between patches, and I'm sure our contributionguidelines mention that make check must pass between patches. Thischange should not pass the checks. It's fine every now and then, we allforget, but I'm trying to run make check and make syntax-check aftereach patch before sending it. Useful command to use from your topicbranch is something along the lines of:git rebase -ix 'make -j9 check && make -j9 syntax-check' master(written by hand from memory, there might be typo, I have a script andbunch of aliases for that)
# util/virsysinfo.hvirSysinfoBaseBoardDefClear;virSysinfoBIOSDefFree;diff --git a/src/util/virsysfs.c b/src/util/virsysfs.cindex 7a98b48..97808be 100644--- a/src/util/virsysfs.c+++ b/src/util/virsysfs.c[...]@@ -227,3 +242,88 @@ virSysfsGetNodeValueBitmap(unsigned int node,VIR_FREE(path);return ret;}++int+virSysfsGetResctrlString(const char* file,'char *file' instead of 'char* file'+ char **value)+{+ char *path = NULL;+ int ret = -1;+ if (virAsprintf(&path, "%s/%s", sysfs_resctrl_path, file) < 0)+ return -1;++ if (!virFileExists(path)) {+ ret = -2;+ goto cleanup;+ }+Now the question is; is it possible for some file to be missing there?I mean some file we'd expect? For the system path, the -2 return valueis there because we need to work on older systems with older kernels andthe files were being added in multiple releases. If there is no needfor distinguishing that, then there is no point in explicitly checkingfor the file to be existing.
And that leads me to another point. Since this patch is by itself, it'snot visible how it is used. It looks good (not considering the thingspointed out above), but there is no point in merging it until there is avalue added. It's just added dead code. But it's something that we'lluse, surely.
MartinP.S.: I just sent [1] the next couple of patches (again, first ones arejust fixing some bullocks I found out that were left in the code-- that just happens when you're working on a codebase with lotsof legacy code), but it adds host cache information to thecapabilities. If you have a minute or two, feel free to check itout and let me know what you think.