2 * QEMU Block driver for RADOS (Ceph)
4 * Copyright (C) 2010-2011 Christian Brunner <chb@muc.de>,
5 * Josh Durgin <josh.durgin@dreamhost.com>
7 * This work is licensed under the terms of the GNU GPL, version 2. See
8 * the COPYING file in the top-level directory.
10 * Contributions after 2012-01-13 are licensed under the terms of the
11 * GNU GPL, version 2 or (at your option) any later version.
16 #include "qemu-common.h"
17 #include "qemu/error-report.h"
18 #include "block/block_int.h"
20 #include <rbd/librbd.h>
23 * When specifying the image filename use:
25 * rbd:poolname/devicename[@snapshotname][:option1=value1[:option2=value2...]]
27 * poolname must be the name of an existing rados pool.
29 * devicename is the name of the rbd image.
31 * Each option given is used to configure rados, and may be any valid
32 * Ceph option, "id", or "conf".
34 * The "id" option indicates what user we should authenticate as to
35 * the Ceph cluster. If it is excluded we will use the Ceph default
38 * The "conf" option specifies a Ceph configuration file to read. If
39 * it is not specified, we will read from the default Ceph locations
40 * (e.g., /etc/ceph/ceph.conf). To avoid reading _any_ configuration
41 * file, specify conf=/dev/null.
43 * Configuration values containing :, @, or = can be escaped with a
47 /* rbd_aio_discard added in 0.1.2 */
48 #if LIBRBD_VERSION_CODE >= LIBRBD_VERSION(0, 1, 2)
49 #define LIBRBD_SUPPORTS_DISCARD
51 #undef LIBRBD_SUPPORTS_DISCARD
54 #define OBJ_MAX_SIZE (1UL << OBJ_DEFAULT_OBJ_ORDER)
56 #define RBD_MAX_CONF_NAME_SIZE 128
57 #define RBD_MAX_CONF_VAL_SIZE 512
58 #define RBD_MAX_CONF_SIZE 1024
59 #define RBD_MAX_POOL_NAME_SIZE 128
60 #define RBD_MAX_SNAP_NAME_SIZE 128
61 #define RBD_MAX_SNAPS 100
70 typedef struct RBDAIOCB
{
71 BlockDriverAIOCB common
;
79 struct BDRVRBDState
*s
;
84 typedef struct RADOSCB
{
87 struct BDRVRBDState
*s
;
95 #define RBD_FD_WRITE 1
97 typedef struct BDRVRBDState
{
100 rados_ioctx_t io_ctx
;
102 char name
[RBD_MAX_IMAGE_NAME_SIZE
];
104 int event_reader_pos
;
108 static void rbd_aio_bh_cb(void *opaque
);
110 static int qemu_rbd_next_tok(char *dst
, int dst_len
,
111 char *src
, char delim
,
121 for (end
= src
; *end
; ++end
) {
125 if (*end
== '\\' && end
[1] != '\0') {
136 error_report("%s too long", name
);
139 error_report("%s too short", name
);
143 pstrcpy(dst
, dst_len
, src
);
148 static void qemu_rbd_unescape(char *src
)
152 for (p
= src
; *src
; ++src
, ++p
) {
153 if (*src
== '\\' && src
[1] != '\0') {
161 static int qemu_rbd_parsename(const char *filename
,
162 char *pool
, int pool_len
,
163 char *snap
, int snap_len
,
164 char *name
, int name_len
,
165 char *conf
, int conf_len
)
171 if (!strstart(filename
, "rbd:", &start
)) {
175 buf
= g_strdup(start
);
180 ret
= qemu_rbd_next_tok(pool
, pool_len
, p
, '/', "pool name", &p
);
185 qemu_rbd_unescape(pool
);
187 if (strchr(p
, '@')) {
188 ret
= qemu_rbd_next_tok(name
, name_len
, p
, '@', "object name", &p
);
192 ret
= qemu_rbd_next_tok(snap
, snap_len
, p
, ':', "snap name", &p
);
193 qemu_rbd_unescape(snap
);
195 ret
= qemu_rbd_next_tok(name
, name_len
, p
, ':', "object name", &p
);
197 qemu_rbd_unescape(name
);
202 ret
= qemu_rbd_next_tok(conf
, conf_len
, p
, '\0', "configuration", &p
);
209 static char *qemu_rbd_parse_clientname(const char *conf
, char *clientname
)
211 const char *p
= conf
;
215 const char *end
= strchr(p
, ':');
223 if (strncmp(p
, "id=", 3) == 0) {
225 strncpy(clientname
, p
+ 3, len
);
226 clientname
[len
] = '\0';
237 static int qemu_rbd_set_conf(rados_t cluster
, const char *conf
)
240 char name
[RBD_MAX_CONF_NAME_SIZE
];
241 char value
[RBD_MAX_CONF_VAL_SIZE
];
244 buf
= g_strdup(conf
);
248 ret
= qemu_rbd_next_tok(name
, sizeof(name
), p
,
249 '=', "conf option name", &p
);
253 qemu_rbd_unescape(name
);
256 error_report("conf option %s has no value", name
);
261 ret
= qemu_rbd_next_tok(value
, sizeof(value
), p
,
262 ':', "conf option value", &p
);
266 qemu_rbd_unescape(value
);
268 if (strcmp(name
, "conf") == 0) {
269 ret
= rados_conf_read_file(cluster
, value
);
271 error_report("error reading conf file %s", value
);
274 } else if (strcmp(name
, "id") == 0) {
275 /* ignore, this is parsed by qemu_rbd_parse_clientname() */
277 ret
= rados_conf_set(cluster
, name
, value
);
279 error_report("invalid conf option %s", name
);
290 static int qemu_rbd_create(const char *filename
, QEMUOptionParameter
*options
)
295 char pool
[RBD_MAX_POOL_NAME_SIZE
];
296 char name
[RBD_MAX_IMAGE_NAME_SIZE
];
297 char snap_buf
[RBD_MAX_SNAP_NAME_SIZE
];
298 char conf
[RBD_MAX_CONF_SIZE
];
299 char clientname_buf
[RBD_MAX_CONF_SIZE
];
302 rados_ioctx_t io_ctx
;
305 if (qemu_rbd_parsename(filename
, pool
, sizeof(pool
),
306 snap_buf
, sizeof(snap_buf
),
308 conf
, sizeof(conf
)) < 0) {
312 /* Read out options */
313 while (options
&& options
->name
) {
314 if (!strcmp(options
->name
, BLOCK_OPT_SIZE
)) {
315 bytes
= options
->value
.n
;
316 } else if (!strcmp(options
->name
, BLOCK_OPT_CLUSTER_SIZE
)) {
317 if (options
->value
.n
) {
318 objsize
= options
->value
.n
;
319 if ((objsize
- 1) & objsize
) { /* not a power of 2? */
320 error_report("obj size needs to be power of 2");
323 if (objsize
< 4096) {
324 error_report("obj size too small");
327 obj_order
= ffs(objsize
) - 1;
333 clientname
= qemu_rbd_parse_clientname(conf
, clientname_buf
);
334 if (rados_create(&cluster
, clientname
) < 0) {
335 error_report("error initializing");
339 if (strstr(conf
, "conf=") == NULL
) {
340 /* try default location, but ignore failure */
341 rados_conf_read_file(cluster
, NULL
);
344 if (conf
[0] != '\0' &&
345 qemu_rbd_set_conf(cluster
, conf
) < 0) {
346 error_report("error setting config options");
347 rados_shutdown(cluster
);
351 if (rados_connect(cluster
) < 0) {
352 error_report("error connecting");
353 rados_shutdown(cluster
);
357 if (rados_ioctx_create(cluster
, pool
, &io_ctx
) < 0) {
358 error_report("error opening pool %s", pool
);
359 rados_shutdown(cluster
);
363 ret
= rbd_create(io_ctx
, name
, bytes
, &obj_order
);
364 rados_ioctx_destroy(io_ctx
);
365 rados_shutdown(cluster
);
371 * This aio completion is being called from qemu_rbd_aio_event_reader()
372 * and runs in qemu context. It schedules a bh, but just in case the aio
373 * was not cancelled before.
375 static void qemu_rbd_complete_aio(RADOSCB
*rcb
)
377 RBDAIOCB
*acb
= rcb
->acb
;
382 if (acb
->cmd
!= RBD_AIO_READ
) {
386 } else if (!acb
->error
) {
387 acb
->ret
= rcb
->size
;
391 memset(rcb
->buf
, 0, rcb
->size
);
394 } else if (r
< rcb
->size
) {
395 memset(rcb
->buf
+ r
, 0, rcb
->size
- r
);
397 acb
->ret
= rcb
->size
;
399 } else if (!acb
->error
) {
403 /* Note that acb->bh can be NULL in case where the aio was cancelled */
404 acb
->bh
= qemu_bh_new(rbd_aio_bh_cb
, acb
);
405 qemu_bh_schedule(acb
->bh
);
410 * aio fd read handler. It runs in the qemu context and calls the
411 * completion handling of completed rados aio operations.
413 static void qemu_rbd_aio_event_reader(void *opaque
)
415 BDRVRBDState
*s
= opaque
;
420 char *p
= (char *)&s
->event_rcb
;
422 /* now read the rcb pointer that was sent from a non qemu thread */
423 ret
= read(s
->fds
[RBD_FD_READ
], p
+ s
->event_reader_pos
,
424 sizeof(s
->event_rcb
) - s
->event_reader_pos
);
426 s
->event_reader_pos
+= ret
;
427 if (s
->event_reader_pos
== sizeof(s
->event_rcb
)) {
428 s
->event_reader_pos
= 0;
429 qemu_rbd_complete_aio(s
->event_rcb
);
432 } while (ret
< 0 && errno
== EINTR
);
435 /* TODO Convert to fine grained options */
436 static QemuOptsList runtime_opts
= {
438 .head
= QTAILQ_HEAD_INITIALIZER(runtime_opts
.head
),
442 .type
= QEMU_OPT_STRING
,
443 .help
= "Specification of the rbd image",
445 { /* end of list */ }
449 static int qemu_rbd_open(BlockDriverState
*bs
, QDict
*options
, int flags
)
451 BDRVRBDState
*s
= bs
->opaque
;
452 char pool
[RBD_MAX_POOL_NAME_SIZE
];
453 char snap_buf
[RBD_MAX_SNAP_NAME_SIZE
];
454 char conf
[RBD_MAX_CONF_SIZE
];
455 char clientname_buf
[RBD_MAX_CONF_SIZE
];
458 Error
*local_err
= NULL
;
459 const char *filename
;
462 opts
= qemu_opts_create_nofail(&runtime_opts
);
463 qemu_opts_absorb_qdict(opts
, options
, &local_err
);
464 if (error_is_set(&local_err
)) {
465 qerror_report_err(local_err
);
466 error_free(local_err
);
471 filename
= qemu_opt_get(opts
, "filename");
473 if (qemu_rbd_parsename(filename
, pool
, sizeof(pool
),
474 snap_buf
, sizeof(snap_buf
),
475 s
->name
, sizeof(s
->name
),
476 conf
, sizeof(conf
)) < 0) {
481 clientname
= qemu_rbd_parse_clientname(conf
, clientname_buf
);
482 r
= rados_create(&s
->cluster
, clientname
);
484 error_report("error initializing");
489 if (snap_buf
[0] != '\0') {
490 s
->snap
= g_strdup(snap_buf
);
494 * Fallback to more conservative semantics if setting cache
495 * options fails. Ignore errors from setting rbd_cache because the
496 * only possible error is that the option does not exist, and
497 * librbd defaults to no caching. If write through caching cannot
498 * be set up, fall back to no caching.
500 if (flags
& BDRV_O_NOCACHE
) {
501 rados_conf_set(s
->cluster
, "rbd_cache", "false");
503 rados_conf_set(s
->cluster
, "rbd_cache", "true");
506 if (strstr(conf
, "conf=") == NULL
) {
507 /* try default location, but ignore failure */
508 rados_conf_read_file(s
->cluster
, NULL
);
511 if (conf
[0] != '\0') {
512 r
= qemu_rbd_set_conf(s
->cluster
, conf
);
514 error_report("error setting config options");
515 goto failed_shutdown
;
519 r
= rados_connect(s
->cluster
);
521 error_report("error connecting");
522 goto failed_shutdown
;
525 r
= rados_ioctx_create(s
->cluster
, pool
, &s
->io_ctx
);
527 error_report("error opening pool %s", pool
);
528 goto failed_shutdown
;
531 r
= rbd_open(s
->io_ctx
, s
->name
, &s
->image
, s
->snap
);
533 error_report("error reading header from %s", s
->name
);
537 bs
->read_only
= (s
->snap
!= NULL
);
539 s
->event_reader_pos
= 0;
540 r
= qemu_pipe(s
->fds
);
542 error_report("error opening eventfd");
545 fcntl(s
->fds
[0], F_SETFL
, O_NONBLOCK
);
546 fcntl(s
->fds
[1], F_SETFL
, O_NONBLOCK
);
547 qemu_aio_set_fd_handler(s
->fds
[RBD_FD_READ
], qemu_rbd_aio_event_reader
,
557 rados_ioctx_destroy(s
->io_ctx
);
559 rados_shutdown(s
->cluster
);
566 static void qemu_rbd_close(BlockDriverState
*bs
)
568 BDRVRBDState
*s
= bs
->opaque
;
572 qemu_aio_set_fd_handler(s
->fds
[RBD_FD_READ
], NULL
, NULL
, NULL
);
575 rados_ioctx_destroy(s
->io_ctx
);
577 rados_shutdown(s
->cluster
);
581 * Cancel aio. Since we don't reference acb in a non qemu threads,
582 * it is safe to access it here.
584 static void qemu_rbd_aio_cancel(BlockDriverAIOCB
*blockacb
)
586 RBDAIOCB
*acb
= (RBDAIOCB
*) blockacb
;
589 while (acb
->status
== -EINPROGRESS
) {
593 qemu_aio_release(acb
);
596 static const AIOCBInfo rbd_aiocb_info
= {
597 .aiocb_size
= sizeof(RBDAIOCB
),
598 .cancel
= qemu_rbd_aio_cancel
,
601 static int qemu_rbd_send_pipe(BDRVRBDState
*s
, RADOSCB
*rcb
)
606 int fd
= s
->fds
[RBD_FD_WRITE
];
608 /* send the op pointer to the qemu thread that is responsible
609 for the aio/op completion. Must do it in a qemu thread context */
610 ret
= write(fd
, (void *)&rcb
, sizeof(rcb
));
614 if (errno
== EINTR
) {
617 if (errno
!= EAGAIN
) {
624 ret
= select(fd
+ 1, NULL
, &wfd
, NULL
, NULL
);
625 } while (ret
< 0 && errno
== EINTR
);
632 * This is the callback function for rbd_aio_read and _write
634 * Note: this function is being called from a non qemu thread so
635 * we need to be careful about what we do here. Generally we only
636 * write to the block notification pipe, and do the rest of the
637 * io completion handling from qemu_rbd_aio_event_reader() which
638 * runs in a qemu context.
640 static void rbd_finish_aiocb(rbd_completion_t c
, RADOSCB
*rcb
)
643 rcb
->ret
= rbd_aio_get_return_value(c
);
645 ret
= qemu_rbd_send_pipe(rcb
->s
, rcb
);
647 error_report("failed writing to acb->s->fds");
652 /* Callback when all queued rbd_aio requests are complete */
654 static void rbd_aio_bh_cb(void *opaque
)
656 RBDAIOCB
*acb
= opaque
;
658 if (acb
->cmd
== RBD_AIO_READ
) {
659 qemu_iovec_from_buf(acb
->qiov
, 0, acb
->bounce
, acb
->qiov
->size
);
661 qemu_vfree(acb
->bounce
);
662 acb
->common
.cb(acb
->common
.opaque
, (acb
->ret
> 0 ? 0 : acb
->ret
));
663 qemu_bh_delete(acb
->bh
);
667 if (!acb
->cancelled
) {
668 qemu_aio_release(acb
);
672 static int rbd_aio_discard_wrapper(rbd_image_t image
,
675 rbd_completion_t comp
)
677 #ifdef LIBRBD_SUPPORTS_DISCARD
678 return rbd_aio_discard(image
, off
, len
, comp
);
684 static int rbd_aio_flush_wrapper(rbd_image_t image
,
685 rbd_completion_t comp
)
687 #ifdef LIBRBD_SUPPORTS_AIO_FLUSH
688 return rbd_aio_flush(image
, comp
);
694 static BlockDriverAIOCB
*rbd_start_aio(BlockDriverState
*bs
,
698 BlockDriverCompletionFunc
*cb
,
709 BDRVRBDState
*s
= bs
->opaque
;
711 acb
= qemu_aio_get(&rbd_aiocb_info
, bs
, cb
, opaque
);
714 if (cmd
== RBD_AIO_DISCARD
|| cmd
== RBD_AIO_FLUSH
) {
717 acb
->bounce
= qemu_blockalign(bs
, qiov
->size
);
724 acb
->status
= -EINPROGRESS
;
726 if (cmd
== RBD_AIO_WRITE
) {
727 qemu_iovec_to_buf(acb
->qiov
, 0, acb
->bounce
, qiov
->size
);
732 off
= sector_num
* BDRV_SECTOR_SIZE
;
733 size
= nb_sectors
* BDRV_SECTOR_SIZE
;
735 rcb
= g_malloc(sizeof(RADOSCB
));
741 r
= rbd_aio_create_completion(rcb
, (rbd_callback_t
) rbd_finish_aiocb
, &c
);
748 r
= rbd_aio_write(s
->image
, off
, size
, buf
, c
);
751 r
= rbd_aio_read(s
->image
, off
, size
, buf
, c
);
753 case RBD_AIO_DISCARD
:
754 r
= rbd_aio_discard_wrapper(s
->image
, off
, size
, c
);
757 r
= rbd_aio_flush_wrapper(s
->image
, c
);
771 qemu_aio_release(acb
);
775 static BlockDriverAIOCB
*qemu_rbd_aio_readv(BlockDriverState
*bs
,
779 BlockDriverCompletionFunc
*cb
,
782 return rbd_start_aio(bs
, sector_num
, qiov
, nb_sectors
, cb
, opaque
,
786 static BlockDriverAIOCB
*qemu_rbd_aio_writev(BlockDriverState
*bs
,
790 BlockDriverCompletionFunc
*cb
,
793 return rbd_start_aio(bs
, sector_num
, qiov
, nb_sectors
, cb
, opaque
,
797 #ifdef LIBRBD_SUPPORTS_AIO_FLUSH
798 static BlockDriverAIOCB
*qemu_rbd_aio_flush(BlockDriverState
*bs
,
799 BlockDriverCompletionFunc
*cb
,
802 return rbd_start_aio(bs
, 0, NULL
, 0, cb
, opaque
, RBD_AIO_FLUSH
);
807 static int qemu_rbd_co_flush(BlockDriverState
*bs
)
809 #if LIBRBD_VERSION_CODE >= LIBRBD_VERSION(0, 1, 1)
810 /* rbd_flush added in 0.1.1 */
811 BDRVRBDState
*s
= bs
->opaque
;
812 return rbd_flush(s
->image
);
819 static int qemu_rbd_getinfo(BlockDriverState
*bs
, BlockDriverInfo
*bdi
)
821 BDRVRBDState
*s
= bs
->opaque
;
822 rbd_image_info_t info
;
825 r
= rbd_stat(s
->image
, &info
, sizeof(info
));
830 bdi
->cluster_size
= info
.obj_size
;
834 static int64_t qemu_rbd_getlength(BlockDriverState
*bs
)
836 BDRVRBDState
*s
= bs
->opaque
;
837 rbd_image_info_t info
;
840 r
= rbd_stat(s
->image
, &info
, sizeof(info
));
848 static int qemu_rbd_truncate(BlockDriverState
*bs
, int64_t offset
)
850 BDRVRBDState
*s
= bs
->opaque
;
853 r
= rbd_resize(s
->image
, offset
);
861 static int qemu_rbd_snap_create(BlockDriverState
*bs
,
862 QEMUSnapshotInfo
*sn_info
)
864 BDRVRBDState
*s
= bs
->opaque
;
867 if (sn_info
->name
[0] == '\0') {
868 return -EINVAL
; /* we need a name for rbd snapshots */
872 * rbd snapshots are using the name as the user controlled unique identifier
873 * we can't use the rbd snapid for that purpose, as it can't be set
875 if (sn_info
->id_str
[0] != '\0' &&
876 strcmp(sn_info
->id_str
, sn_info
->name
) != 0) {
880 if (strlen(sn_info
->name
) >= sizeof(sn_info
->id_str
)) {
884 r
= rbd_snap_create(s
->image
, sn_info
->name
);
886 error_report("failed to create snap: %s", strerror(-r
));
893 static int qemu_rbd_snap_remove(BlockDriverState
*bs
,
894 const char *snapshot_name
)
896 BDRVRBDState
*s
= bs
->opaque
;
899 r
= rbd_snap_remove(s
->image
, snapshot_name
);
903 static int qemu_rbd_snap_rollback(BlockDriverState
*bs
,
904 const char *snapshot_name
)
906 BDRVRBDState
*s
= bs
->opaque
;
909 r
= rbd_snap_rollback(s
->image
, snapshot_name
);
913 static int qemu_rbd_snap_list(BlockDriverState
*bs
,
914 QEMUSnapshotInfo
**psn_tab
)
916 BDRVRBDState
*s
= bs
->opaque
;
917 QEMUSnapshotInfo
*sn_info
, *sn_tab
= NULL
;
919 rbd_snap_info_t
*snaps
;
920 int max_snaps
= RBD_MAX_SNAPS
;
923 snaps
= g_malloc(sizeof(*snaps
) * max_snaps
);
924 snap_count
= rbd_snap_list(s
->image
, snaps
, &max_snaps
);
925 if (snap_count
< 0) {
928 } while (snap_count
== -ERANGE
);
930 if (snap_count
<= 0) {
934 sn_tab
= g_malloc0(snap_count
* sizeof(QEMUSnapshotInfo
));
936 for (i
= 0; i
< snap_count
; i
++) {
937 const char *snap_name
= snaps
[i
].name
;
939 sn_info
= sn_tab
+ i
;
940 pstrcpy(sn_info
->id_str
, sizeof(sn_info
->id_str
), snap_name
);
941 pstrcpy(sn_info
->name
, sizeof(sn_info
->name
), snap_name
);
943 sn_info
->vm_state_size
= snaps
[i
].size
;
944 sn_info
->date_sec
= 0;
945 sn_info
->date_nsec
= 0;
946 sn_info
->vm_clock_nsec
= 0;
948 rbd_snap_list_end(snaps
);
955 #ifdef LIBRBD_SUPPORTS_DISCARD
956 static BlockDriverAIOCB
* qemu_rbd_aio_discard(BlockDriverState
*bs
,
959 BlockDriverCompletionFunc
*cb
,
962 return rbd_start_aio(bs
, sector_num
, NULL
, nb_sectors
, cb
, opaque
,
967 static QEMUOptionParameter qemu_rbd_create_options
[] = {
969 .name
= BLOCK_OPT_SIZE
,
971 .help
= "Virtual disk size"
974 .name
= BLOCK_OPT_CLUSTER_SIZE
,
976 .help
= "RBD object size"
981 static BlockDriver bdrv_rbd
= {
982 .format_name
= "rbd",
983 .instance_size
= sizeof(BDRVRBDState
),
984 .bdrv_file_open
= qemu_rbd_open
,
985 .bdrv_close
= qemu_rbd_close
,
986 .bdrv_create
= qemu_rbd_create
,
987 .bdrv_has_zero_init
= bdrv_has_zero_init_1
,
988 .bdrv_get_info
= qemu_rbd_getinfo
,
989 .create_options
= qemu_rbd_create_options
,
990 .bdrv_getlength
= qemu_rbd_getlength
,
991 .bdrv_truncate
= qemu_rbd_truncate
,
992 .protocol_name
= "rbd",
994 .bdrv_aio_readv
= qemu_rbd_aio_readv
,
995 .bdrv_aio_writev
= qemu_rbd_aio_writev
,
997 #ifdef LIBRBD_SUPPORTS_AIO_FLUSH
998 .bdrv_aio_flush
= qemu_rbd_aio_flush
,
1000 .bdrv_co_flush_to_disk
= qemu_rbd_co_flush
,
1003 #ifdef LIBRBD_SUPPORTS_DISCARD
1004 .bdrv_aio_discard
= qemu_rbd_aio_discard
,
1007 .bdrv_snapshot_create
= qemu_rbd_snap_create
,
1008 .bdrv_snapshot_delete
= qemu_rbd_snap_remove
,
1009 .bdrv_snapshot_list
= qemu_rbd_snap_list
,
1010 .bdrv_snapshot_goto
= qemu_rbd_snap_rollback
,
1013 static void bdrv_rbd_init(void)
1015 bdrv_register(&bdrv_rbd
);
1018 block_init(bdrv_rbd_init
);