Re: [PATCH 2/2] storage: Improve error handling on cdrom backend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> ---
>  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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux