Am 17.05.2022 um 09:10 hat Stefano Garzarella geschrieben:
> If the namespace does not exist, rbd_create() fails with -ENOENT and
> QEMU reports a generic "error rbd create: No such file or directory":
> 
>     $ qemu-img create rbd:rbd/namespace/image 1M
>     Formatting 'rbd:rbd/namespace/image', fmt=raw size=1048576
>     qemu-img: rbd:rbd/namespace/image: error rbd create: No such file or 
> directory
> 
> Unfortunately rados_ioctx_set_namespace() does not fail if the namespace
> does not exist, so let's use rbd_namespace_exists() in qemu_rbd_connect()
> to check if the namespace exists, reporting a more understandable error:
> 
>     $ qemu-img create rbd:rbd/namespace/image 1M
>     Formatting 'rbd:rbd/namespace/image', fmt=raw size=1048576
>     qemu-img: rbd:rbd/namespace/image: namespace 'namespace' does not exist
> 
> Reported-by: Tingting Mao <[email protected]>
> Reviewed-by: Ilya Dryomov <[email protected]>
> Signed-off-by: Stefano Garzarella <[email protected]>

Thanks, applied to the block branch.

Kevin


Reply via email to