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.
14 #include "qemu/osdep.h"
16 #include "qapi/error.h"
17 #include "qemu/error-report.h"
18 #include "block/block_int.h"
19 #include "crypto/secret.h"
20 #include "qemu/cutils.h"
22 #include <rbd/librbd.h>
25 * When specifying the image filename use:
27 * rbd:poolname/devicename[@snapshotname][:option1=value1[:option2=value2...]]
29 * poolname must be the name of an existing rados pool.
31 * devicename is the name of the rbd image.
33 * Each option given is used to configure rados, and may be any valid
34 * Ceph option, "id", or "conf".
36 * The "id" option indicates what user we should authenticate as to
37 * the Ceph cluster. If it is excluded we will use the Ceph default
40 * The "conf" option specifies a Ceph configuration file to read. If
41 * it is not specified, we will read from the default Ceph locations
42 * (e.g., /etc/ceph/ceph.conf). To avoid reading _any_ configuration
43 * file, specify conf=/dev/null.
45 * Configuration values containing :, @, or = can be escaped with a
49 /* rbd_aio_discard added in 0.1.2 */
50 #if LIBRBD_VERSION_CODE >= LIBRBD_VERSION(0, 1, 2)
51 #define LIBRBD_SUPPORTS_DISCARD
53 #undef LIBRBD_SUPPORTS_DISCARD
56 #define OBJ_MAX_SIZE (1UL << OBJ_DEFAULT_OBJ_ORDER)
58 #define RBD_MAX_CONF_NAME_SIZE 128
59 #define RBD_MAX_CONF_VAL_SIZE 512
60 #define RBD_MAX_CONF_SIZE 1024
61 #define RBD_MAX_POOL_NAME_SIZE 128
62 #define RBD_MAX_SNAP_NAME_SIZE 128
63 #define RBD_MAX_SNAPS 100
72 typedef struct RBDAIOCB
{
80 struct BDRVRBDState
*s
;
83 typedef struct RADOSCB
{
85 struct BDRVRBDState
*s
;
91 typedef struct BDRVRBDState
{
95 char name
[RBD_MAX_IMAGE_NAME_SIZE
];
99 static int qemu_rbd_next_tok(char *dst
, int dst_len
,
100 char *src
, char delim
,
102 char **p
, Error
**errp
)
110 for (end
= src
; *end
; ++end
) {
114 if (*end
== '\\' && end
[1] != '\0') {
125 error_setg(errp
, "%s too long", name
);
128 error_setg(errp
, "%s too short", name
);
132 pstrcpy(dst
, dst_len
, src
);
137 static void qemu_rbd_unescape(char *src
)
141 for (p
= src
; *src
; ++src
, ++p
) {
142 if (*src
== '\\' && src
[1] != '\0') {
150 static int qemu_rbd_parsename(const char *filename
,
151 char *pool
, int pool_len
,
152 char *snap
, int snap_len
,
153 char *name
, int name_len
,
154 char *conf
, int conf_len
,
161 if (!strstart(filename
, "rbd:", &start
)) {
162 error_setg(errp
, "File name must start with 'rbd:'");
166 buf
= g_strdup(start
);
171 ret
= qemu_rbd_next_tok(pool
, pool_len
, p
,
172 '/', "pool name", &p
, errp
);
177 qemu_rbd_unescape(pool
);
179 if (strchr(p
, '@')) {
180 ret
= qemu_rbd_next_tok(name
, name_len
, p
,
181 '@', "object name", &p
, errp
);
185 ret
= qemu_rbd_next_tok(snap
, snap_len
, p
,
186 ':', "snap name", &p
, errp
);
187 qemu_rbd_unescape(snap
);
189 ret
= qemu_rbd_next_tok(name
, name_len
, p
,
190 ':', "object name", &p
, errp
);
192 qemu_rbd_unescape(name
);
197 ret
= qemu_rbd_next_tok(conf
, conf_len
, p
,
198 '\0', "configuration", &p
, errp
);
205 static char *qemu_rbd_parse_clientname(const char *conf
, char *clientname
)
207 const char *p
= conf
;
211 const char *end
= strchr(p
, ':');
219 if (strncmp(p
, "id=", 3) == 0) {
221 strncpy(clientname
, p
+ 3, len
);
222 clientname
[len
] = '\0';
234 static int qemu_rbd_set_auth(rados_t cluster
, const char *secretid
,
241 gchar
*secret
= qcrypto_secret_lookup_as_base64(secretid
,
247 rados_conf_set(cluster
, "key", secret
);
254 static int qemu_rbd_set_conf(rados_t cluster
, const char *conf
,
255 bool only_read_conf_file
,
259 char name
[RBD_MAX_CONF_NAME_SIZE
];
260 char value
[RBD_MAX_CONF_VAL_SIZE
];
263 buf
= g_strdup(conf
);
267 ret
= qemu_rbd_next_tok(name
, sizeof(name
), p
,
268 '=', "conf option name", &p
, errp
);
272 qemu_rbd_unescape(name
);
275 error_setg(errp
, "conf option %s has no value", name
);
280 ret
= qemu_rbd_next_tok(value
, sizeof(value
), p
,
281 ':', "conf option value", &p
, errp
);
285 qemu_rbd_unescape(value
);
287 if (strcmp(name
, "conf") == 0) {
288 /* read the conf file alone, so it doesn't override more
289 specific settings for a particular device */
290 if (only_read_conf_file
) {
291 ret
= rados_conf_read_file(cluster
, value
);
293 error_setg(errp
, "error reading conf file %s", value
);
297 } else if (strcmp(name
, "id") == 0) {
298 /* ignore, this is parsed by qemu_rbd_parse_clientname() */
299 } else if (!only_read_conf_file
) {
300 ret
= rados_conf_set(cluster
, name
, value
);
302 error_setg(errp
, "invalid conf option %s", name
);
313 static int qemu_rbd_create(const char *filename
, QemuOpts
*opts
, Error
**errp
)
315 Error
*local_err
= NULL
;
319 char pool
[RBD_MAX_POOL_NAME_SIZE
];
320 char name
[RBD_MAX_IMAGE_NAME_SIZE
];
321 char snap_buf
[RBD_MAX_SNAP_NAME_SIZE
];
322 char conf
[RBD_MAX_CONF_SIZE
];
323 char clientname_buf
[RBD_MAX_CONF_SIZE
];
325 const char *secretid
;
327 rados_ioctx_t io_ctx
;
330 secretid
= qemu_opt_get(opts
, "password-secret");
332 if (qemu_rbd_parsename(filename
, pool
, sizeof(pool
),
333 snap_buf
, sizeof(snap_buf
),
335 conf
, sizeof(conf
), &local_err
) < 0) {
336 error_propagate(errp
, local_err
);
340 /* Read out options */
341 bytes
= ROUND_UP(qemu_opt_get_size_del(opts
, BLOCK_OPT_SIZE
, 0),
343 objsize
= qemu_opt_get_size_del(opts
, BLOCK_OPT_CLUSTER_SIZE
, 0);
345 if ((objsize
- 1) & objsize
) { /* not a power of 2? */
346 error_setg(errp
, "obj size needs to be power of 2");
349 if (objsize
< 4096) {
350 error_setg(errp
, "obj size too small");
353 obj_order
= ctz32(objsize
);
356 clientname
= qemu_rbd_parse_clientname(conf
, clientname_buf
);
357 if (rados_create(&cluster
, clientname
) < 0) {
358 error_setg(errp
, "error initializing");
362 if (strstr(conf
, "conf=") == NULL
) {
363 /* try default location, but ignore failure */
364 rados_conf_read_file(cluster
, NULL
);
365 } else if (conf
[0] != '\0' &&
366 qemu_rbd_set_conf(cluster
, conf
, true, &local_err
) < 0) {
367 rados_shutdown(cluster
);
368 error_propagate(errp
, local_err
);
372 if (conf
[0] != '\0' &&
373 qemu_rbd_set_conf(cluster
, conf
, false, &local_err
) < 0) {
374 rados_shutdown(cluster
);
375 error_propagate(errp
, local_err
);
379 if (qemu_rbd_set_auth(cluster
, secretid
, errp
) < 0) {
380 rados_shutdown(cluster
);
384 if (rados_connect(cluster
) < 0) {
385 error_setg(errp
, "error connecting");
386 rados_shutdown(cluster
);
390 if (rados_ioctx_create(cluster
, pool
, &io_ctx
) < 0) {
391 error_setg(errp
, "error opening pool %s", pool
);
392 rados_shutdown(cluster
);
396 ret
= rbd_create(io_ctx
, name
, bytes
, &obj_order
);
397 rados_ioctx_destroy(io_ctx
);
398 rados_shutdown(cluster
);
404 * This aio completion is being called from rbd_finish_bh() and runs in qemu
407 static void qemu_rbd_complete_aio(RADOSCB
*rcb
)
409 RBDAIOCB
*acb
= rcb
->acb
;
414 if (acb
->cmd
!= RBD_AIO_READ
) {
418 } else if (!acb
->error
) {
419 acb
->ret
= rcb
->size
;
423 memset(rcb
->buf
, 0, rcb
->size
);
426 } else if (r
< rcb
->size
) {
427 memset(rcb
->buf
+ r
, 0, rcb
->size
- r
);
429 acb
->ret
= rcb
->size
;
431 } else if (!acb
->error
) {
438 if (acb
->cmd
== RBD_AIO_READ
) {
439 qemu_iovec_from_buf(acb
->qiov
, 0, acb
->bounce
, acb
->qiov
->size
);
441 qemu_vfree(acb
->bounce
);
442 acb
->common
.cb(acb
->common
.opaque
, (acb
->ret
> 0 ? 0 : acb
->ret
));
447 /* TODO Convert to fine grained options */
448 static QemuOptsList runtime_opts
= {
450 .head
= QTAILQ_HEAD_INITIALIZER(runtime_opts
.head
),
454 .type
= QEMU_OPT_STRING
,
455 .help
= "Specification of the rbd image",
458 .name
= "password-secret",
459 .type
= QEMU_OPT_STRING
,
460 .help
= "ID of secret providing the password",
462 { /* end of list */ }
466 static int qemu_rbd_open(BlockDriverState
*bs
, QDict
*options
, int flags
,
469 BDRVRBDState
*s
= bs
->opaque
;
470 char pool
[RBD_MAX_POOL_NAME_SIZE
];
471 char snap_buf
[RBD_MAX_SNAP_NAME_SIZE
];
472 char conf
[RBD_MAX_CONF_SIZE
];
473 char clientname_buf
[RBD_MAX_CONF_SIZE
];
475 const char *secretid
;
477 Error
*local_err
= NULL
;
478 const char *filename
;
481 opts
= qemu_opts_create(&runtime_opts
, NULL
, 0, &error_abort
);
482 qemu_opts_absorb_qdict(opts
, options
, &local_err
);
484 error_propagate(errp
, local_err
);
489 filename
= qemu_opt_get(opts
, "filename");
490 secretid
= qemu_opt_get(opts
, "password-secret");
492 if (qemu_rbd_parsename(filename
, pool
, sizeof(pool
),
493 snap_buf
, sizeof(snap_buf
),
494 s
->name
, sizeof(s
->name
),
495 conf
, sizeof(conf
), errp
) < 0) {
500 clientname
= qemu_rbd_parse_clientname(conf
, clientname_buf
);
501 r
= rados_create(&s
->cluster
, clientname
);
503 error_setg(errp
, "error initializing");
508 if (snap_buf
[0] != '\0') {
509 s
->snap
= g_strdup(snap_buf
);
512 if (strstr(conf
, "conf=") == NULL
) {
513 /* try default location, but ignore failure */
514 rados_conf_read_file(s
->cluster
, NULL
);
515 } else if (conf
[0] != '\0') {
516 r
= qemu_rbd_set_conf(s
->cluster
, conf
, true, errp
);
518 goto failed_shutdown
;
522 if (conf
[0] != '\0') {
523 r
= qemu_rbd_set_conf(s
->cluster
, conf
, false, errp
);
525 goto failed_shutdown
;
529 if (qemu_rbd_set_auth(s
->cluster
, secretid
, errp
) < 0) {
531 goto failed_shutdown
;
535 * Fallback to more conservative semantics if setting cache
536 * options fails. Ignore errors from setting rbd_cache because the
537 * only possible error is that the option does not exist, and
538 * librbd defaults to no caching. If write through caching cannot
539 * be set up, fall back to no caching.
541 if (flags
& BDRV_O_NOCACHE
) {
542 rados_conf_set(s
->cluster
, "rbd_cache", "false");
544 rados_conf_set(s
->cluster
, "rbd_cache", "true");
547 r
= rados_connect(s
->cluster
);
549 error_setg(errp
, "error connecting");
550 goto failed_shutdown
;
553 r
= rados_ioctx_create(s
->cluster
, pool
, &s
->io_ctx
);
555 error_setg(errp
, "error opening pool %s", pool
);
556 goto failed_shutdown
;
559 r
= rbd_open(s
->io_ctx
, s
->name
, &s
->image
, s
->snap
);
561 error_setg(errp
, "error reading header from %s", s
->name
);
565 bs
->read_only
= (s
->snap
!= NULL
);
571 rados_ioctx_destroy(s
->io_ctx
);
573 rados_shutdown(s
->cluster
);
580 static void qemu_rbd_close(BlockDriverState
*bs
)
582 BDRVRBDState
*s
= bs
->opaque
;
585 rados_ioctx_destroy(s
->io_ctx
);
587 rados_shutdown(s
->cluster
);
590 static const AIOCBInfo rbd_aiocb_info
= {
591 .aiocb_size
= sizeof(RBDAIOCB
),
594 static void rbd_finish_bh(void *opaque
)
596 RADOSCB
*rcb
= opaque
;
597 qemu_bh_delete(rcb
->acb
->bh
);
598 qemu_rbd_complete_aio(rcb
);
602 * This is the callback function for rbd_aio_read and _write
604 * Note: this function is being called from a non qemu thread so
605 * we need to be careful about what we do here. Generally we only
606 * schedule a BH, and do the rest of the io completion handling
607 * from rbd_finish_bh() which runs in a qemu context.
609 static void rbd_finish_aiocb(rbd_completion_t c
, RADOSCB
*rcb
)
611 RBDAIOCB
*acb
= rcb
->acb
;
613 rcb
->ret
= rbd_aio_get_return_value(c
);
616 acb
->bh
= aio_bh_new(bdrv_get_aio_context(acb
->common
.bs
),
618 qemu_bh_schedule(acb
->bh
);
621 static int rbd_aio_discard_wrapper(rbd_image_t image
,
624 rbd_completion_t comp
)
626 #ifdef LIBRBD_SUPPORTS_DISCARD
627 return rbd_aio_discard(image
, off
, len
, comp
);
633 static int rbd_aio_flush_wrapper(rbd_image_t image
,
634 rbd_completion_t comp
)
636 #ifdef LIBRBD_SUPPORTS_AIO_FLUSH
637 return rbd_aio_flush(image
, comp
);
643 static BlockAIOCB
*rbd_start_aio(BlockDriverState
*bs
,
647 BlockCompletionFunc
*cb
,
658 BDRVRBDState
*s
= bs
->opaque
;
660 acb
= qemu_aio_get(&rbd_aiocb_info
, bs
, cb
, opaque
);
663 if (cmd
== RBD_AIO_DISCARD
|| cmd
== RBD_AIO_FLUSH
) {
666 acb
->bounce
= qemu_try_blockalign(bs
, qiov
->size
);
667 if (acb
->bounce
== NULL
) {
676 if (cmd
== RBD_AIO_WRITE
) {
677 qemu_iovec_to_buf(acb
->qiov
, 0, acb
->bounce
, qiov
->size
);
682 off
= sector_num
* BDRV_SECTOR_SIZE
;
683 size
= nb_sectors
* BDRV_SECTOR_SIZE
;
685 rcb
= g_new(RADOSCB
, 1);
690 r
= rbd_aio_create_completion(rcb
, (rbd_callback_t
) rbd_finish_aiocb
, &c
);
697 r
= rbd_aio_write(s
->image
, off
, size
, buf
, c
);
700 r
= rbd_aio_read(s
->image
, off
, size
, buf
, c
);
702 case RBD_AIO_DISCARD
:
703 r
= rbd_aio_discard_wrapper(s
->image
, off
, size
, c
);
706 r
= rbd_aio_flush_wrapper(s
->image
, c
);
713 goto failed_completion
;
722 qemu_vfree(acb
->bounce
);
727 static BlockAIOCB
*qemu_rbd_aio_readv(BlockDriverState
*bs
,
731 BlockCompletionFunc
*cb
,
734 return rbd_start_aio(bs
, sector_num
, qiov
, nb_sectors
, cb
, opaque
,
738 static BlockAIOCB
*qemu_rbd_aio_writev(BlockDriverState
*bs
,
742 BlockCompletionFunc
*cb
,
745 return rbd_start_aio(bs
, sector_num
, qiov
, nb_sectors
, cb
, opaque
,
749 #ifdef LIBRBD_SUPPORTS_AIO_FLUSH
750 static BlockAIOCB
*qemu_rbd_aio_flush(BlockDriverState
*bs
,
751 BlockCompletionFunc
*cb
,
754 return rbd_start_aio(bs
, 0, NULL
, 0, cb
, opaque
, RBD_AIO_FLUSH
);
759 static int qemu_rbd_co_flush(BlockDriverState
*bs
)
761 #if LIBRBD_VERSION_CODE >= LIBRBD_VERSION(0, 1, 1)
762 /* rbd_flush added in 0.1.1 */
763 BDRVRBDState
*s
= bs
->opaque
;
764 return rbd_flush(s
->image
);
771 static int qemu_rbd_getinfo(BlockDriverState
*bs
, BlockDriverInfo
*bdi
)
773 BDRVRBDState
*s
= bs
->opaque
;
774 rbd_image_info_t info
;
777 r
= rbd_stat(s
->image
, &info
, sizeof(info
));
782 bdi
->cluster_size
= info
.obj_size
;
786 static int64_t qemu_rbd_getlength(BlockDriverState
*bs
)
788 BDRVRBDState
*s
= bs
->opaque
;
789 rbd_image_info_t info
;
792 r
= rbd_stat(s
->image
, &info
, sizeof(info
));
800 static int qemu_rbd_truncate(BlockDriverState
*bs
, int64_t offset
)
802 BDRVRBDState
*s
= bs
->opaque
;
805 r
= rbd_resize(s
->image
, offset
);
813 static int qemu_rbd_snap_create(BlockDriverState
*bs
,
814 QEMUSnapshotInfo
*sn_info
)
816 BDRVRBDState
*s
= bs
->opaque
;
819 if (sn_info
->name
[0] == '\0') {
820 return -EINVAL
; /* we need a name for rbd snapshots */
824 * rbd snapshots are using the name as the user controlled unique identifier
825 * we can't use the rbd snapid for that purpose, as it can't be set
827 if (sn_info
->id_str
[0] != '\0' &&
828 strcmp(sn_info
->id_str
, sn_info
->name
) != 0) {
832 if (strlen(sn_info
->name
) >= sizeof(sn_info
->id_str
)) {
836 r
= rbd_snap_create(s
->image
, sn_info
->name
);
838 error_report("failed to create snap: %s", strerror(-r
));
845 static int qemu_rbd_snap_remove(BlockDriverState
*bs
,
846 const char *snapshot_id
,
847 const char *snapshot_name
,
850 BDRVRBDState
*s
= bs
->opaque
;
853 if (!snapshot_name
) {
854 error_setg(errp
, "rbd need a valid snapshot name");
858 /* If snapshot_id is specified, it must be equal to name, see
859 qemu_rbd_snap_list() */
860 if (snapshot_id
&& strcmp(snapshot_id
, snapshot_name
)) {
862 "rbd do not support snapshot id, it should be NULL or "
863 "equal to snapshot name");
867 r
= rbd_snap_remove(s
->image
, snapshot_name
);
869 error_setg_errno(errp
, -r
, "Failed to remove the snapshot");
874 static int qemu_rbd_snap_rollback(BlockDriverState
*bs
,
875 const char *snapshot_name
)
877 BDRVRBDState
*s
= bs
->opaque
;
880 r
= rbd_snap_rollback(s
->image
, snapshot_name
);
884 static int qemu_rbd_snap_list(BlockDriverState
*bs
,
885 QEMUSnapshotInfo
**psn_tab
)
887 BDRVRBDState
*s
= bs
->opaque
;
888 QEMUSnapshotInfo
*sn_info
, *sn_tab
= NULL
;
890 rbd_snap_info_t
*snaps
;
891 int max_snaps
= RBD_MAX_SNAPS
;
894 snaps
= g_new(rbd_snap_info_t
, max_snaps
);
895 snap_count
= rbd_snap_list(s
->image
, snaps
, &max_snaps
);
896 if (snap_count
<= 0) {
899 } while (snap_count
== -ERANGE
);
901 if (snap_count
<= 0) {
905 sn_tab
= g_new0(QEMUSnapshotInfo
, snap_count
);
907 for (i
= 0; i
< snap_count
; i
++) {
908 const char *snap_name
= snaps
[i
].name
;
910 sn_info
= sn_tab
+ i
;
911 pstrcpy(sn_info
->id_str
, sizeof(sn_info
->id_str
), snap_name
);
912 pstrcpy(sn_info
->name
, sizeof(sn_info
->name
), snap_name
);
914 sn_info
->vm_state_size
= snaps
[i
].size
;
915 sn_info
->date_sec
= 0;
916 sn_info
->date_nsec
= 0;
917 sn_info
->vm_clock_nsec
= 0;
919 rbd_snap_list_end(snaps
);
927 #ifdef LIBRBD_SUPPORTS_DISCARD
928 static BlockAIOCB
* qemu_rbd_aio_discard(BlockDriverState
*bs
,
931 BlockCompletionFunc
*cb
,
934 return rbd_start_aio(bs
, sector_num
, NULL
, nb_sectors
, cb
, opaque
,
939 #ifdef LIBRBD_SUPPORTS_INVALIDATE
940 static void qemu_rbd_invalidate_cache(BlockDriverState
*bs
,
943 BDRVRBDState
*s
= bs
->opaque
;
944 int r
= rbd_invalidate_cache(s
->image
);
946 error_setg_errno(errp
, -r
, "Failed to invalidate the cache");
951 static QemuOptsList qemu_rbd_create_opts
= {
952 .name
= "rbd-create-opts",
953 .head
= QTAILQ_HEAD_INITIALIZER(qemu_rbd_create_opts
.head
),
956 .name
= BLOCK_OPT_SIZE
,
957 .type
= QEMU_OPT_SIZE
,
958 .help
= "Virtual disk size"
961 .name
= BLOCK_OPT_CLUSTER_SIZE
,
962 .type
= QEMU_OPT_SIZE
,
963 .help
= "RBD object size"
966 .name
= "password-secret",
967 .type
= QEMU_OPT_STRING
,
968 .help
= "ID of secret providing the password",
970 { /* end of list */ }
974 static BlockDriver bdrv_rbd
= {
975 .format_name
= "rbd",
976 .instance_size
= sizeof(BDRVRBDState
),
977 .bdrv_needs_filename
= true,
978 .bdrv_file_open
= qemu_rbd_open
,
979 .bdrv_close
= qemu_rbd_close
,
980 .bdrv_create
= qemu_rbd_create
,
981 .bdrv_has_zero_init
= bdrv_has_zero_init_1
,
982 .bdrv_get_info
= qemu_rbd_getinfo
,
983 .create_opts
= &qemu_rbd_create_opts
,
984 .bdrv_getlength
= qemu_rbd_getlength
,
985 .bdrv_truncate
= qemu_rbd_truncate
,
986 .protocol_name
= "rbd",
988 .bdrv_aio_readv
= qemu_rbd_aio_readv
,
989 .bdrv_aio_writev
= qemu_rbd_aio_writev
,
991 #ifdef LIBRBD_SUPPORTS_AIO_FLUSH
992 .bdrv_aio_flush
= qemu_rbd_aio_flush
,
994 .bdrv_co_flush_to_disk
= qemu_rbd_co_flush
,
997 #ifdef LIBRBD_SUPPORTS_DISCARD
998 .bdrv_aio_discard
= qemu_rbd_aio_discard
,
1001 .bdrv_snapshot_create
= qemu_rbd_snap_create
,
1002 .bdrv_snapshot_delete
= qemu_rbd_snap_remove
,
1003 .bdrv_snapshot_list
= qemu_rbd_snap_list
,
1004 .bdrv_snapshot_goto
= qemu_rbd_snap_rollback
,
1005 #ifdef LIBRBD_SUPPORTS_INVALIDATE
1006 .bdrv_invalidate_cache
= qemu_rbd_invalidate_cache
,
1010 static void bdrv_rbd_init(void)
1012 bdrv_register(&bdrv_rbd
);
1015 block_init(bdrv_rbd_init
);