From: Michal Privoznik Date: Wed, 8 Mar 2017 14:56:36 +0000 (+0100) Subject: qemuBuildMemoryBackendStr: Don't overwrite @force X-Git-Tag: v3.2.0-rc1~278 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4346c9eb97ce61fea0b883d5784295c9c4a09b15;p=thirdparty%2Flibvirt.git qemuBuildMemoryBackendStr: Don't overwrite @force This is an input argument. We should not overwrite it. Signed-off-by: Michal Privoznik --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index b484b7ba07..b30bb670f8 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3302,7 +3302,6 @@ qemuBuildMemoryBackendStr(unsigned long long size, if (def->mem.source == VIR_DOMAIN_MEMORY_SOURCE_FILE) { /* we can have both pagesize and mem source, then check mem source first */ - force = true; if (virJSONValueObjectAdd(props, "s:mem-path", cfg->memoryBackingDir, NULL) < 0) @@ -3372,7 +3371,8 @@ qemuBuildMemoryBackendStr(unsigned long long size, } /* If none of the following is requested... */ - if (!needHugepage && !userNodeset && !memAccess && !nodeSpecified && !force) { + if (!needHugepage && !userNodeset && !memAccess && !nodeSpecified && + def->mem.source != VIR_DOMAIN_MEMORY_SOURCE_FILE && !force) { /* report back that using the new backend is not necessary * to achieve the desired configuration */ ret = 1;