Re: [libvirt] [PATCH] rbd: Open in Read-Only mode when refreshing a volume

2016-01-29 Thread John Ferlan


On 01/28/2016 05:20 AM, Wido den Hollander wrote:
> By opening a RBD volume in Read-Only we do not register a
> watcher on the header object inside the Ceph cluster.
> 
> Refreshing a volume only calls rbd_stat() which is a operation
> which does not write to a RBD image.
> 
> This allows us to use a cephx user which has no write
> permissions if we would want to use the libvirt storage pool
> for informational purposes only.
> 
> It also saves us a write into the Ceph cluster which should
> speed up refreshing a RBD pool.
> 
> rbd_open_read_only() is available in all librbd versions which
> also support rbd_open().
> 
> Signed-off-by: Wido den Hollander 
> ---
>  src/storage/storage_backend_rbd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

ACK - and pushed

John

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


[libvirt] [PATCH] rbd: Open in Read-Only mode when refreshing a volume

2016-01-28 Thread Wido den Hollander
By opening a RBD volume in Read-Only we do not register a
watcher on the header object inside the Ceph cluster.

Refreshing a volume only calls rbd_stat() which is a operation
which does not write to a RBD image.

This allows us to use a cephx user which has no write
permissions if we would want to use the libvirt storage pool
for informational purposes only.

It also saves us a write into the Ceph cluster which should
speed up refreshing a RBD pool.

rbd_open_read_only() is available in all librbd versions which
also support rbd_open().

Signed-off-by: Wido den Hollander 
---
 src/storage/storage_backend_rbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/storage/storage_backend_rbd.c 
b/src/storage/storage_backend_rbd.c
index 8c7a80d..3ab7912 100644
--- a/src/storage/storage_backend_rbd.c
+++ b/src/storage/storage_backend_rbd.c
@@ -283,7 +283,7 @@ static int 
volStorageBackendRBDRefreshVolInfo(virStorageVolDefPtr vol,
 int r = 0;
 rbd_image_t image = NULL;
 
-r = rbd_open(ptr->ioctx, vol->name, , NULL);
+r = rbd_open_read_only(ptr->ioctx, vol->name, , NULL);
 if (r < 0) {
 ret = -r;
 virReportSystemError(-r, _("failed to open the RBD image '%s'"),
-- 
1.9.1

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