[libvirt] [PATCH 4/4] storage: Always report an error from VolOpen

Ján Tomko jtomko at redhat.com
Mon Mar 31 09:06:56 UTC 2014


On 03/31/2014 02:42 AM, Cole Robinson wrote:
> VolOpen notifies the user of a potentially non-fatal failure by
> returning -2 and logging a VIR_WARN or VIR_INFO. Unfortunately most
> callers treat -2 as fatal but don't actually report any message with
> the error APIs.
> 
> Change VolOpen to always report an error, and fix the one caller that
> was actually handling -2 to explicitly unset the raised error. Tweak
> some of the other call sites to properly propagate the newly raised
> error.
> ---
> Unfortunately this makes libvirtd startup pretty noisy on stderr, since
> logging is done at ErrorReport time, even if the error is never dispatched,
> and every directory pool will try to probe the illegal volumes $target/. and
> $target/.. . Suggestions welcome
> 

I think volOpen should report errors in all cases only if
VIR_STORAGE_VOL_OPEN_ERROR is set (not only because we can't really unlog errors)

Every caller expect for virStorageBackendProbeTarget (where
virStorageBackendFileSystemRefresh handles -2) has this flag set.

Jan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140331/4c58c877/attachment-0001.sig>


More information about the libvir-list mailing list