]> git.ipfire.org Git - thirdparty/qemu.git/commit
vl: Fix an assert failure in error path
authorZhenzhong Duan <zhenzhong.duan@intel.com>
Thu, 10 Jun 2021 08:47:41 +0000 (16:47 +0800)
committerMichael Roth <michael.roth@amd.com>
Thu, 14 Oct 2021 21:04:11 +0000 (16:04 -0500)
commitcdb8a71e2e4bcef3a7815d6a3d02bb8da2a1001d
tree062df59890de690e14c37ce38d6b5f9e740555aa
parent5b55370e28e262fba0c95f5dc05e9551c875671a
vl: Fix an assert failure in error path

Based on the description of error_setg(), the local variable err in
qemu_maybe_daemonize() should be initialized to NULL.

Without fix, the uninitialized *errp triggers assert failure which
doesn't show much valuable information.

Before the fix:
qemu-system-x86_64: ../util/error.c:59: error_setv: Assertion `*errp == NULL' failed.

After fix:
qemu-system-x86_64: cannot create PID file: Cannot open pid file: Permission denied

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Message-Id: <20210610084741.456260-1-zhenzhong.duan@intel.com>
Cc: qemu-stable@nongnu.org
Fixes: 0546c0609c ("vl: split various early command line options to a separate function", 2020-12-10)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 38f71349c7c4969bc14da4da1c70b8cc4078d596)
Signed-off-by: Michael Roth <michael.roth@amd.com>
softmmu/vl.c