
On Tue, Nov 24, 2015 at 03:57:14PM -0500, John Ferlan wrote:
Similar to the openflags VIR_STORAGE_VOL_OPEN_NOERROR processing, if some read processing operation fails, check the readflags for the corresponding error flag being set. If so, rather then causing an error - use VIR_WARN to flag the error, but return -2 which some callers can use to perform specific actions.
Signed-off-by: John Ferlan <jferlan@redhat.com> --- src/storage/storage_backend.c | 107 +++++++++++++++++++++++++++++++----------- src/storage/storage_backend.h | 11 +++++ 2 files changed, 90 insertions(+), 28 deletions(-)
diff --git a/src/storage/storage_backend.h b/src/storage/storage_backend.h index aa9008e..e3ff306 100644 --- a/src/storage/storage_backend.h +++ b/src/storage/storage_backend.h @@ -179,6 +179,17 @@ enum { VIR_STORAGE_VOL_OPEN_DIR = 1 << 4, /* directories okay */ };
+/* VolReadErrorMode flags + * If flag is present, then operation won't cause fatal error for + * specified operation, rather a VIR_WARN will be issued and a -2 returned + * for function call + */ +enum { + VIR_STORAGE_VOL_SEEK_ERROR = 1 << 0, /* don't error on (l)seek */
+ VIR_STORAGE_VOL_READ_ERROR = 1 << 1, /* don't error on *read */
This is the only flag used in this series. Also, naming it VIR_STORAGE_VOL_READ_NOERROR or VIR_STORAGE_VOL_READ_IGNORE_ERROR would make its meaning more obvious. ACK with the unused flags dropped. Jan