]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: set OOM in virCopyLastError if error is not set
authorNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Mon, 2 Jul 2018 11:16:52 +0000 (14:16 +0300)
committerNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Thu, 19 Jul 2018 07:49:46 +0000 (10:49 +0300)
commit1bff5bbe25eb7a7e7a4e0067c4ca7cbc1cb34999
treea1aeea49eb84c3ac62e07ea93a9a6cfa0e14769d
parent36d426a6114a14ea3e1a022216a95953483af731
util: set OOM in virCopyLastError if error is not set

virCopyLastError is intended to be used after last error is set.
However due to virLastErrorObject failures (very unlikely though
as thread local error is allocated on first use) we can have zero
fields in a copy as a result. In particular code field can be set
to VIR_ERR_OK.

In some places (qemu monitor, qemu agent and qemu migaration code
for example) we use copy result as a flag and this leads to bugs.

Let's set OOM-like error in copy in case of virLastErrorObject failures.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
.gnulib
src/util/virerror.c