virConfPtr properties)
{
int type = VIR_DOMAIN_FS_TYPE_MOUNT;
- char *value = NULL;
+ VIR_AUTOFREE(char *) value = NULL;
if (virConfGetValueString(properties, "lxc.rootfs", &value) <= 0)
return -1;
static int
lxcCreateConsoles(virDomainDefPtr def, virConfPtr properties)
{
- char *value = NULL;
+ VIR_AUTOFREE(char *) value = NULL;
int nbttys = 0;
virDomainChrDefPtr console;
size_t i;
static int
lxcSetMemTune(virDomainDefPtr def, virConfPtr properties)
{
- char *value = NULL;
+ VIR_AUTOFREE(char *) value = NULL;
unsigned long long size = 0;
if (virConfGetValueString(properties,
size = size / 1024;
virDomainDefSetMemoryTotal(def, size);
def->mem.hard_limit = virMemoryLimitTruncate(size);
+ VIR_FREE(value);
}
if (virConfGetValueString(properties,
if (lxcConvertSize(value, &size) < 0)
return -1;
def->mem.soft_limit = virMemoryLimitTruncate(size / 1024);
+ VIR_FREE(value);
}
if (virConfGetValueString(properties,
static int
lxcSetCpuTune(virDomainDefPtr def, virConfPtr properties)
{
- char *value = NULL;
+ VIR_AUTOFREE(char *) value = NULL;
if (virConfGetValueString(properties, "lxc.cgroup.cpu.shares",
&value) > 0) {
if (virStrToLong_ull(value, NULL, 10, &def->cputune.shares) < 0)
goto error;
def->cputune.sharesSpecified = true;
+ VIR_FREE(value);
}
if (virConfGetValueString(properties, "lxc.cgroup.cpu.cfs_quota_us",
&value) > 0) {
if (virStrToLong_ll(value, NULL, 10, &def->cputune.quota) < 0)
goto error;
+ VIR_FREE(value);
}
if (virConfGetValueString(properties, "lxc.cgroup.cpu.cfs_period_us",
- &value) > 0) {
+ &value) > 0) {
if (virStrToLong_ull(value, NULL, 10, &def->cputune.period) < 0)
goto error;
}
static int
lxcSetCpusetTune(virDomainDefPtr def, virConfPtr properties)
{
- char *value = NULL;
+ VIR_AUTOFREE(char *) value = NULL;
virBitmapPtr nodeset = NULL;
if (virConfGetValueString(properties, "lxc.cgroup.cpuset.cpus",
if (virBitmapParse(value, &def->cpumask, VIR_DOMAIN_CPUMASK_LEN) < 0)
return -1;
def->placement_mode = VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC;
+ VIR_FREE(value);
}
if (virConfGetValueString(properties, "lxc.cgroup.cpuset.mems",
- &value) > 0) {
+ &value) > 0) {
if (virBitmapParse(value, &nodeset, VIR_DOMAIN_CPUMASK_LEN) < 0)
return -1;
if (virDomainNumatuneSet(def->numa,
static int
lxcSetBlkioTune(virDomainDefPtr def, virConfPtr properties)
{
- char *value = NULL;
+ VIR_AUTOFREE(char *) value = NULL;
if (virConfGetValueString(properties, "lxc.cgroup.blkio.weight",
&value) > 0) {
static void
lxcSetCapDrop(virDomainDefPtr def, virConfPtr properties)
{
- char *value = NULL;
+ VIR_AUTOFREE(char *) value = NULL;
char **toDrop = NULL;
const char *capString;
size_t i;
{
virDomainDefPtr vmdef = NULL;
virConfPtr properties = NULL;
- char *value = NULL;
+ VIR_AUTOFREE(char *) value = NULL;
if (!(properties = virConfReadString(config, VIR_CONF_FLAG_LXC_FORMAT)))
return NULL;
else if (arch == VIR_ARCH_NONE && STREQ(value, "amd64"))
arch = VIR_ARCH_X86_64;
vmdef->os.arch = arch;
+ VIR_FREE(value);
}
if (VIR_STRDUP(vmdef->os.init, "/sbin/init") < 0)