util: Prefer virGetLastErrorMessage over direct err->message usage

Signed-off-by: Ramy Elkest <ramyelkest@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
ramyelkest 2018-05-05 13:04:19 +01:00 committed by Erik Skultety
parent 3f4db69c2f
commit 52d88d11db
1 changed files with 1 additions and 2 deletions

View File

@ -157,9 +157,8 @@ virFileCacheLoad(virFileCachePtr cache,
}
if (!(loadData = cache->handlers.loadFile(file, name, cache->priv))) {
virErrorPtr err = virGetLastError();
VIR_WARN("Failed to load cached data from '%s' for '%s': %s",
file, name, err ? NULLSTR(err->message) : "unknown error");
file, name, virGetLastErrorMessage());
virResetLastError();
ret = 0;
goto cleanup;