On 03/31/2014 05:06 AM, Ján Tomko wrote:
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
Good idea, I've sent a v2 with that change.
- Cole