[libvirt] [PATCH 2/2] storage: Improve error handling on cdrom backend
Michal Privoznik
mprivozn at redhat.com
Tue Jul 10 06:38:48 UTC 2018
On 07/03/2018 04:29 AM, Han Han wrote:
> Implement virFileCdromStatus() in virStorageBackendVolOpen to show
> detailed errors or warnings of cdrom instead of general Input/output error.
>
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1596096
> Signed-off-by: Han Han <hhan at redhat.com>
> ---
> src/storage/storage_util.c | 38 ++++++++++++++++++++++++++++++++++++++
> 1 file changed, 38 insertions(+)
>
> diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
> index a701a75702..5a7ed4c76f 100644
> --- a/src/storage/storage_util.c
> +++ b/src/storage/storage_util.c
> @@ -1538,6 +1538,44 @@ virStorageBackendVolOpen(const char *path, struct stat *sb,
> return -1;
> }
>
> + if (virFileIsCDROM(path) == 1) {
> + switch (virFileCdromStatus(path)) {
See? With my proposal this would be a single function call.
Michal
More information about the libvir-list
mailing list