qemuBuildMemoryBackendStr: Don't overwrite @force

This is an input argument. We should not overwrite it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2017-03-08 15:56:36 +01:00
parent 32b675456e
commit 4346c9eb97
1 changed files with 2 additions and 2 deletions

View File

@ -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;