]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Allow skipping some errors in qemuDomainStorageOpenStat
authorPeter Krempa <pkrempa@redhat.com>
Wed, 14 Aug 2019 14:00:27 +0000 (16:00 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 16 Aug 2019 11:17:40 +0000 (13:17 +0200)
commitba6c12df2ceb4df9bfb7ce95deef04f96bf29462
treede4b4cfe30d358c02692321a0de37859eb3f3d04
parent68639829c69ba3ed369413771bf0abceb33c3668
qemu: Allow skipping some errors in qemuDomainStorageOpenStat

Some callers of this function actually don't care about errors and reset
it. The message is still logged which might irritate users in this case.

Add a boolean flag which will do few checks whether it actually makes
sense to even try opening the storage file. For local files we check
whether it exists and for remote files we at first see whether we even
have a storage driver backend for it in the first place before trying to
open it.

Other problems will still report errors but these are the most common
scenarios which can happen here.

This patch changes the return value of the function so that the caller
is able to differentiate the possibilities.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_driver.c