Re: [PATCH] rbd: Use rbd_create3 to create RBD format 2 images by default

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

 





On 01/30/2014 02:02 PM, Ján Tomko wrote:
On 12/11/2013 03:47 PM, Wido den Hollander wrote:
This new RBD format supports snapshotting and cloning. By having
libvirt create images in format 2 end-users of the created images
can benefit of the new RBD format.

Older versions of libvirt can work with this new RBD format as long
as librbd supports format 2, something that all recent versions of
librbd do.

How recent? It might be nicer to mention the version number.

Also, the patch no longer applies.


I sent a revised version of the patch to the list last week. The commit message now shows the librbd versions required and it also applies to master again.

Could you take a look at it again? It would really help the Ceph project.

Thanks a lot!

Wido


Signed-off-by: Wido den Hollander <wido@xxxxxxxxx>
---
  src/storage/storage_backend_rbd.c |   23 +++++++++++++++++++++--
  1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
index 4b6f18c..f3dd7a0 100644
--- a/src/storage/storage_backend_rbd.c
+++ b/src/storage/storage_backend_rbd.c
@@ -435,6 +435,26 @@ cleanup:
      return ret;
  }

+static int virStorageBackendRBDCreateImage(rados_ioctx_t io,
+                                           char *name, long capacity)
+{
+    int order = 0;
+    #if LIBRBD_VERSION_CODE > 260

This will fail 'make syntax-check' as it's not indented properly, see:
http://libvirt.org/hacking.html#preprocessor

It would also be easier to read if compared against LIBRBD_VERSION(0, 1, x),
instead of 260.

+    uint64_t features = 3;
+    uint64_t stripe_count = 1;
+    uint64_t stripe_unit = 4194304;
+

Can these numbers be represented by more descriptive constants from librbd
header files?

Jan


--
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]