On a Thursday in 2021, Praveen K Paladugu wrote:
From: Vineeth Pillai <viremana(a)linux.microsoft.com>
Signed-off-by: Vineeth Pillai <viremana(a)linux.microsoft.com>
Signed-off-by: Praveen K Paladugu <prapal(a)linux.microsoft.com>
---
src/ch/ch_domain.c | 30 +++++++++
src/ch/ch_domain.h | 1 +
src/ch/ch_driver.c | 151 +++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 182 insertions(+)
@@ -1129,6 +1130,154 @@ chDomainGetVcpus(virDomainPtr dom,
return ret;
}
+static int
+chDomainPinVcpuLive(virDomainObj *vm,
+ virDomainDef *def,
+ int vcpu,
+ virCHDriver *driver,
+ virCHDriverConfig *cfg,
+ virBitmap *cpumap)
+{
+ virBitmap *tmpmap = NULL;
You can use
g_autoptr(virBitmap) tmpmap = NULL;
to automatically free the memory when it goes out of scope
instead of manually calling virBitmapFree
+ virDomainVcpuDef *vcpuinfo;
+ virCHDomainObjPrivate *priv = vm->privateData;
+ virCgroup *cgroup_vcpu = NULL;
+ g_autofree char *str = NULL;
+ int ret = -1;
+
+ if (!virCHDomainHasVcpuPids(vm)) {
+
+ if (persistentDef) {
+ virBitmapFree(vcpuinfo->cpumask);
+ vcpuinfo->cpumask = pcpumap;
+ pcpumap = NULL;
+
+ // ret = virDomainDefSave(persistentDef, driver->xmlopt, cfg->configDir);
There's no need for this comment.
+ goto endjob;
Jano