提交 ea119118 编写于 作者: J Ján Tomko

qemu: initialize variables in qemuParseCommandLine

Commit 6700062f introduced a jump to error which skipped the
initialization of def:

qemu/qemu_parse_command.c:1870:9: error: variable 'def' is
used uninitialized whenever 'if' condition is true
      [-Werror,-Wsometimes-uninitialized]
    if (!(qemuCaps = virQEMUCapsCacheLookup(capsCache, progargv[0])))

Initialize def to fix this warning and qemuCaps, to prevent
a future error like this.
Signed-off-by: NJán Tomko <jtomko@redhat.com>
上级 6700062f
......@@ -1838,7 +1838,7 @@ qemuParseCommandLine(virFileCachePtr capsCache,
virDomainChrSourceDefPtr *monConfig,
bool *monJSON)
{
virDomainDefPtr def;
virDomainDefPtr def = NULL;
size_t i;
bool nographics = false;
bool fullscreen = false;
......@@ -1852,7 +1852,7 @@ qemuParseCommandLine(virFileCachePtr capsCache,
virDomainDiskDefPtr disk = NULL;
const char *ceph_args = qemuFindEnv(progenv, "CEPH_ARGS");
bool have_sdl = false;
virQEMUCapsPtr qemuCaps;
virQEMUCapsPtr qemuCaps = NULL;
if (pidfile)
*pidfile = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册