提交 104011ea 编写于 作者: P Peter Krempa

qemu: Don't return memory device config on error in qemuBuildMemoryBackendStr

In the last section if the function determines that the config is
invalid when QEMU doesn't support the memory device the JSON config
object would be returned even if it doesn't make sense.

Assign the object to be returned only on success.
上级 c35b2776
......@@ -4750,9 +4750,6 @@ qemuBuildMemoryBackendStr(unsigned long long size,
goto cleanup;
}
*backendProps = props;
props = NULL;
if (!hugepage) {
bool nodeSpecified = virDomainNumatuneNodeSpecified(def->numa, guestNode);
......@@ -4767,11 +4764,15 @@ qemuBuildMemoryBackendStr(unsigned long long size,
/* report back that using the new backend is not necessary to achieve
* the desired configuration */
if (!userNodeset && !nodeSpecified) {
*backendProps = props;
props = NULL;
ret = 1;
goto cleanup;
}
}
*backendProps = props;
props = NULL;
ret = 0;
cleanup:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册