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
];
105 int event_reader_pos
;
109 static void rbd_aio_bh_cb(void *opaque
);
111 static int qemu_rbd_next_tok(char *dst
, int dst_len
,
112 char *src
, char delim
,
122 for (end
= src
; *end
; ++end
) {
126 if (*end
== '\\' && end
[1] != '\0') {
137 error_report("%s too long", name
);
140 error_report("%s too short", name
);
144 pstrcpy(dst
, dst_len
, src
);
149 static void qemu_rbd_unescape(char *src
)
153 for (p
= src
; *src
; ++src
, ++p
) {
154 if (*src
== '\\' && src
[1] != '\0') {
162 static int qemu_rbd_parsename(const char *filename
,
163 char *pool
, int pool_len
,
164 char *snap
, int snap_len
,
165 char *name
, int name_len
,
166 char *conf
, int conf_len
)
172 if (!strstart(filename
, "rbd:", &start
)) {
176 buf
= g_strdup(start
);
181 ret
= qemu_rbd_next_tok(pool
, pool_len
, p
, '/', "pool name", &p
);
186 qemu_rbd_unescape(pool
);
188 if (strchr(p
, '@')) {
189 ret
= qemu_rbd_next_tok(name
, name_len
, p
, '@', "object name", &p
);
193 ret
= qemu_rbd_next_tok(snap
, snap_len
, p
, ':', "snap name", &p
);
194 qemu_rbd_unescape(snap
);
196 ret
= qemu_rbd_next_tok(name
, name_len
, p
, ':', "object name", &p
);
198 qemu_rbd_unescape(name
);
203 ret
= qemu_rbd_next_tok(conf
, conf_len
, p
, '\0', "configuration", &p
);
210 static char *qemu_rbd_parse_clientname(const char *conf
, char *clientname
)
212 const char *p
= conf
;
216 const char *end
= strchr(p
, ':');
224 if (strncmp(p
, "id=", 3) == 0) {
226 strncpy(clientname
, p
+ 3, len
);
227 clientname
[len
] = '\0';
238 static int qemu_rbd_set_conf(rados_t cluster
, const char *conf
)
241 char name
[RBD_MAX_CONF_NAME_SIZE
];
242 char value
[RBD_MAX_CONF_VAL_SIZE
];
245 buf
= g_strdup(conf
);
249 ret
= qemu_rbd_next_tok(name
, sizeof(name
), p
,
250 '=', "conf option name", &p
);
254 qemu_rbd_unescape(name
);
257 error_report("conf option %s has no value", name
);
262 ret
= qemu_rbd_next_tok(value
, sizeof(value
), p
,
263 ':', "conf option value", &p
);
267 qemu_rbd_unescape(value
);
269 if (strcmp(name
, "conf") == 0) {
270 ret
= rados_conf_read_file(cluster
, value
);
272 error_report("error reading conf file %s", value
);
275 } else if (strcmp(name
, "id") == 0) {
276 /* ignore, this is parsed by qemu_rbd_parse_clientname() */
278 ret
= rados_conf_set(cluster
, name
, value
);
280 error_report("invalid conf option %s", name
);
291 static int qemu_rbd_create(const char *filename
, QEMUOptionParameter
*options
)
296 char pool
[RBD_MAX_POOL_NAME_SIZE
];
297 char name
[RBD_MAX_IMAGE_NAME_SIZE
];
298 char snap_buf
[RBD_MAX_SNAP_NAME_SIZE
];
299 char conf
[RBD_MAX_CONF_SIZE
];
300 char clientname_buf
[RBD_MAX_CONF_SIZE
];
303 rados_ioctx_t io_ctx
;
306 if (qemu_rbd_parsename(filename
, pool
, sizeof(pool
),
307 snap_buf
, sizeof(snap_buf
),
309 conf
, sizeof(conf
)) < 0) {
313 /* Read out options */
314 while (options
&& options
->name
) {
315 if (!strcmp(options
->name
, BLOCK_OPT_SIZE
)) {
316 bytes
= options
->value
.n
;
317 } else if (!strcmp(options
->name
, BLOCK_OPT_CLUSTER_SIZE
)) {
318 if (options
->value
.n
) {
319 objsize
= options
->value
.n
;
320 if ((objsize
- 1) & objsize
) { /* not a power of 2? */
321 error_report("obj size needs to be power of 2");
324 if (objsize
< 4096) {
325 error_report("obj size too small");
328 obj_order
= ffs(objsize
) - 1;
334 clientname
= qemu_rbd_parse_clientname(conf
, clientname_buf
);
335 if (rados_create(&cluster
, clientname
) < 0) {
336 error_report("error initializing");
340 if (strstr(conf
, "conf=") == NULL
) {
341 /* try default location, but ignore failure */
342 rados_conf_read_file(cluster
, NULL
);
345 if (conf
[0] != '\0' &&
346 qemu_rbd_set_conf(cluster
, conf
) < 0) {
347 error_report("error setting config options");
348 rados_shutdown(cluster
);
352 if (rados_connect(cluster
) < 0) {
353 error_report("error connecting");
354 rados_shutdown(cluster
);
358 if (rados_ioctx_create(cluster
, pool
, &io_ctx
) < 0) {
359 error_report("error opening pool %s", pool
);
360 rados_shutdown(cluster
);
364 ret
= rbd_create(io_ctx
, name
, bytes
, &obj_order
);
365 rados_ioctx_destroy(io_ctx
);
366 rados_shutdown(cluster
);
372 * This aio completion is being called from qemu_rbd_aio_event_reader()
373 * and runs in qemu context. It schedules a bh, but just in case the aio
374 * was not cancelled before.
376 static void qemu_rbd_complete_aio(RADOSCB
*rcb
)
378 RBDAIOCB
*acb
= rcb
->acb
;
383 if (acb
->cmd
!= RBD_AIO_READ
) {
387 } else if (!acb
->error
) {
388 acb
->ret
= rcb
->size
;
392 memset(rcb
->buf
, 0, rcb
->size
);
395 } else if (r
< rcb
->size
) {
396 memset(rcb
->buf
+ r
, 0, rcb
->size
- r
);
398 acb
->ret
= rcb
->size
;
400 } else if (!acb
->error
) {
404 /* Note that acb->bh can be NULL in case where the aio was cancelled */
405 acb
->bh
= qemu_bh_new(rbd_aio_bh_cb
, acb
);
406 qemu_bh_schedule(acb
->bh
);
411 * aio fd read handler. It runs in the qemu context and calls the
412 * completion handling of completed rados aio operations.
414 static void qemu_rbd_aio_event_reader(void *opaque
)
416 BDRVRBDState
*s
= opaque
;
421 char *p
= (char *)&s
->event_rcb
;
423 /* now read the rcb pointer that was sent from a non qemu thread */
424 ret
= read(s
->fds
[RBD_FD_READ
], p
+ s
->event_reader_pos
,
425 sizeof(s
->event_rcb
) - s
->event_reader_pos
);
427 s
->event_reader_pos
+= ret
;
428 if (s
->event_reader_pos
== sizeof(s
->event_rcb
)) {
429 s
->event_reader_pos
= 0;
430 qemu_rbd_complete_aio(s
->event_rcb
);
434 } while (ret
< 0 && errno
== EINTR
);
437 static int qemu_rbd_aio_flush_cb(void *opaque
)
439 BDRVRBDState
*s
= opaque
;
441 return (s
->qemu_aio_count
> 0);
444 /* TODO Convert to fine grained options */
445 static QemuOptsList runtime_opts
= {
447 .head
= QTAILQ_HEAD_INITIALIZER(runtime_opts
.head
),
451 .type
= QEMU_OPT_STRING
,
452 .help
= "Specification of the rbd image",
454 { /* end of list */ }
458 static int qemu_rbd_open(BlockDriverState
*bs
, QDict
*options
, int flags
)
460 BDRVRBDState
*s
= bs
->opaque
;
461 char pool
[RBD_MAX_POOL_NAME_SIZE
];
462 char snap_buf
[RBD_MAX_SNAP_NAME_SIZE
];
463 char conf
[RBD_MAX_CONF_SIZE
];
464 char clientname_buf
[RBD_MAX_CONF_SIZE
];
467 Error
*local_err
= NULL
;
468 const char *filename
;
471 opts
= qemu_opts_create_nofail(&runtime_opts
);
472 qemu_opts_absorb_qdict(opts
, options
, &local_err
);
473 if (error_is_set(&local_err
)) {
474 qerror_report_err(local_err
);
475 error_free(local_err
);
480 filename
= qemu_opt_get(opts
, "filename");
483 if (qemu_rbd_parsename(filename
, pool
, sizeof(pool
),
484 snap_buf
, sizeof(snap_buf
),
485 s
->name
, sizeof(s
->name
),
486 conf
, sizeof(conf
)) < 0) {
490 clientname
= qemu_rbd_parse_clientname(conf
, clientname_buf
);
491 r
= rados_create(&s
->cluster
, clientname
);
493 error_report("error initializing");
498 if (snap_buf
[0] != '\0') {
499 s
->snap
= g_strdup(snap_buf
);
503 * Fallback to more conservative semantics if setting cache
504 * options fails. Ignore errors from setting rbd_cache because the
505 * only possible error is that the option does not exist, and
506 * librbd defaults to no caching. If write through caching cannot
507 * be set up, fall back to no caching.
509 if (flags
& BDRV_O_NOCACHE
) {
510 rados_conf_set(s
->cluster
, "rbd_cache", "false");
512 rados_conf_set(s
->cluster
, "rbd_cache", "true");
515 if (strstr(conf
, "conf=") == NULL
) {
516 /* try default location, but ignore failure */
517 rados_conf_read_file(s
->cluster
, NULL
);
520 if (conf
[0] != '\0') {
521 r
= qemu_rbd_set_conf(s
->cluster
, conf
);
523 error_report("error setting config options");
524 goto failed_shutdown
;
528 r
= rados_connect(s
->cluster
);
530 error_report("error connecting");
531 goto failed_shutdown
;
534 r
= rados_ioctx_create(s
->cluster
, pool
, &s
->io_ctx
);
536 error_report("error opening pool %s", pool
);
537 goto failed_shutdown
;
540 r
= rbd_open(s
->io_ctx
, s
->name
, &s
->image
, s
->snap
);
542 error_report("error reading header from %s", s
->name
);
546 bs
->read_only
= (s
->snap
!= NULL
);
548 s
->event_reader_pos
= 0;
549 r
= qemu_pipe(s
->fds
);
551 error_report("error opening eventfd");
554 fcntl(s
->fds
[0], F_SETFL
, O_NONBLOCK
);
555 fcntl(s
->fds
[1], F_SETFL
, O_NONBLOCK
);
556 qemu_aio_set_fd_handler(s
->fds
[RBD_FD_READ
], qemu_rbd_aio_event_reader
,
557 NULL
, qemu_rbd_aio_flush_cb
, s
);
565 rados_ioctx_destroy(s
->io_ctx
);
567 rados_shutdown(s
->cluster
);
572 static void qemu_rbd_close(BlockDriverState
*bs
)
574 BDRVRBDState
*s
= bs
->opaque
;
578 qemu_aio_set_fd_handler(s
->fds
[RBD_FD_READ
], NULL
, NULL
, NULL
, NULL
);
581 rados_ioctx_destroy(s
->io_ctx
);
583 rados_shutdown(s
->cluster
);
587 * Cancel aio. Since we don't reference acb in a non qemu threads,
588 * it is safe to access it here.
590 static void qemu_rbd_aio_cancel(BlockDriverAIOCB
*blockacb
)
592 RBDAIOCB
*acb
= (RBDAIOCB
*) blockacb
;
595 while (acb
->status
== -EINPROGRESS
) {
599 qemu_aio_release(acb
);
602 static const AIOCBInfo rbd_aiocb_info
= {
603 .aiocb_size
= sizeof(RBDAIOCB
),
604 .cancel
= qemu_rbd_aio_cancel
,
607 static int qemu_rbd_send_pipe(BDRVRBDState
*s
, RADOSCB
*rcb
)
612 int fd
= s
->fds
[RBD_FD_WRITE
];
614 /* send the op pointer to the qemu thread that is responsible
615 for the aio/op completion. Must do it in a qemu thread context */
616 ret
= write(fd
, (void *)&rcb
, sizeof(rcb
));
620 if (errno
== EINTR
) {
623 if (errno
!= EAGAIN
) {
630 ret
= select(fd
+ 1, NULL
, &wfd
, NULL
, NULL
);
631 } while (ret
< 0 && errno
== EINTR
);
638 * This is the callback function for rbd_aio_read and _write
640 * Note: this function is being called from a non qemu thread so
641 * we need to be careful about what we do here. Generally we only
642 * write to the block notification pipe, and do the rest of the
643 * io completion handling from qemu_rbd_aio_event_reader() which
644 * runs in a qemu context.
646 static void rbd_finish_aiocb(rbd_completion_t c
, RADOSCB
*rcb
)
649 rcb
->ret
= rbd_aio_get_return_value(c
);
651 ret
= qemu_rbd_send_pipe(rcb
->s
, rcb
);
653 error_report("failed writing to acb->s->fds");
658 /* Callback when all queued rbd_aio requests are complete */
660 static void rbd_aio_bh_cb(void *opaque
)
662 RBDAIOCB
*acb
= opaque
;
664 if (acb
->cmd
== RBD_AIO_READ
) {
665 qemu_iovec_from_buf(acb
->qiov
, 0, acb
->bounce
, acb
->qiov
->size
);
667 qemu_vfree(acb
->bounce
);
668 acb
->common
.cb(acb
->common
.opaque
, (acb
->ret
> 0 ? 0 : acb
->ret
));
669 qemu_bh_delete(acb
->bh
);
673 if (!acb
->cancelled
) {
674 qemu_aio_release(acb
);
678 static int rbd_aio_discard_wrapper(rbd_image_t image
,
681 rbd_completion_t comp
)
683 #ifdef LIBRBD_SUPPORTS_DISCARD
684 return rbd_aio_discard(image
, off
, len
, comp
);
690 static int rbd_aio_flush_wrapper(rbd_image_t image
,
691 rbd_completion_t comp
)
693 #ifdef LIBRBD_SUPPORTS_AIO_FLUSH
694 return rbd_aio_flush(image
, comp
);
700 static BlockDriverAIOCB
*rbd_start_aio(BlockDriverState
*bs
,
704 BlockDriverCompletionFunc
*cb
,
715 BDRVRBDState
*s
= bs
->opaque
;
717 acb
= qemu_aio_get(&rbd_aiocb_info
, bs
, cb
, opaque
);
720 if (cmd
== RBD_AIO_DISCARD
|| cmd
== RBD_AIO_FLUSH
) {
723 acb
->bounce
= qemu_blockalign(bs
, qiov
->size
);
730 acb
->status
= -EINPROGRESS
;
732 if (cmd
== RBD_AIO_WRITE
) {
733 qemu_iovec_to_buf(acb
->qiov
, 0, acb
->bounce
, qiov
->size
);
738 off
= sector_num
* BDRV_SECTOR_SIZE
;
739 size
= nb_sectors
* BDRV_SECTOR_SIZE
;
741 s
->qemu_aio_count
++; /* All the RADOSCB */
743 rcb
= g_malloc(sizeof(RADOSCB
));
749 r
= rbd_aio_create_completion(rcb
, (rbd_callback_t
) rbd_finish_aiocb
, &c
);
756 r
= rbd_aio_write(s
->image
, off
, size
, buf
, c
);
759 r
= rbd_aio_read(s
->image
, off
, size
, buf
, c
);
761 case RBD_AIO_DISCARD
:
762 r
= rbd_aio_discard_wrapper(s
->image
, off
, size
, c
);
765 r
= rbd_aio_flush_wrapper(s
->image
, c
);
780 qemu_aio_release(acb
);
784 static BlockDriverAIOCB
*qemu_rbd_aio_readv(BlockDriverState
*bs
,
788 BlockDriverCompletionFunc
*cb
,
791 return rbd_start_aio(bs
, sector_num
, qiov
, nb_sectors
, cb
, opaque
,
795 static BlockDriverAIOCB
*qemu_rbd_aio_writev(BlockDriverState
*bs
,
799 BlockDriverCompletionFunc
*cb
,
802 return rbd_start_aio(bs
, sector_num
, qiov
, nb_sectors
, cb
, opaque
,
806 #ifdef LIBRBD_SUPPORTS_AIO_FLUSH
807 static BlockDriverAIOCB
*qemu_rbd_aio_flush(BlockDriverState
*bs
,
808 BlockDriverCompletionFunc
*cb
,
811 return rbd_start_aio(bs
, 0, NULL
, 0, cb
, opaque
, RBD_AIO_FLUSH
);
816 static int qemu_rbd_co_flush(BlockDriverState
*bs
)
818 #if LIBRBD_VERSION_CODE >= LIBRBD_VERSION(0, 1, 1)
819 /* rbd_flush added in 0.1.1 */
820 BDRVRBDState
*s
= bs
->opaque
;
821 return rbd_flush(s
->image
);
828 static int qemu_rbd_getinfo(BlockDriverState
*bs
, BlockDriverInfo
*bdi
)
830 BDRVRBDState
*s
= bs
->opaque
;
831 rbd_image_info_t info
;
834 r
= rbd_stat(s
->image
, &info
, sizeof(info
));
839 bdi
->cluster_size
= info
.obj_size
;
843 static int64_t qemu_rbd_getlength(BlockDriverState
*bs
)
845 BDRVRBDState
*s
= bs
->opaque
;
846 rbd_image_info_t info
;
849 r
= rbd_stat(s
->image
, &info
, sizeof(info
));
857 static int qemu_rbd_truncate(BlockDriverState
*bs
, int64_t offset
)
859 BDRVRBDState
*s
= bs
->opaque
;
862 r
= rbd_resize(s
->image
, offset
);
870 static int qemu_rbd_snap_create(BlockDriverState
*bs
,
871 QEMUSnapshotInfo
*sn_info
)
873 BDRVRBDState
*s
= bs
->opaque
;
876 if (sn_info
->name
[0] == '\0') {
877 return -EINVAL
; /* we need a name for rbd snapshots */
881 * rbd snapshots are using the name as the user controlled unique identifier
882 * we can't use the rbd snapid for that purpose, as it can't be set
884 if (sn_info
->id_str
[0] != '\0' &&
885 strcmp(sn_info
->id_str
, sn_info
->name
) != 0) {
889 if (strlen(sn_info
->name
) >= sizeof(sn_info
->id_str
)) {
893 r
= rbd_snap_create(s
->image
, sn_info
->name
);
895 error_report("failed to create snap: %s", strerror(-r
));
902 static int qemu_rbd_snap_remove(BlockDriverState
*bs
,
903 const char *snapshot_name
)
905 BDRVRBDState
*s
= bs
->opaque
;
908 r
= rbd_snap_remove(s
->image
, snapshot_name
);
912 static int qemu_rbd_snap_rollback(BlockDriverState
*bs
,
913 const char *snapshot_name
)
915 BDRVRBDState
*s
= bs
->opaque
;
918 r
= rbd_snap_rollback(s
->image
, snapshot_name
);
922 static int qemu_rbd_snap_list(BlockDriverState
*bs
,
923 QEMUSnapshotInfo
**psn_tab
)
925 BDRVRBDState
*s
= bs
->opaque
;
926 QEMUSnapshotInfo
*sn_info
, *sn_tab
= NULL
;
928 rbd_snap_info_t
*snaps
;
929 int max_snaps
= RBD_MAX_SNAPS
;
932 snaps
= g_malloc(sizeof(*snaps
) * max_snaps
);
933 snap_count
= rbd_snap_list(s
->image
, snaps
, &max_snaps
);
934 if (snap_count
< 0) {
937 } while (snap_count
== -ERANGE
);
939 if (snap_count
<= 0) {
943 sn_tab
= g_malloc0(snap_count
* sizeof(QEMUSnapshotInfo
));
945 for (i
= 0; i
< snap_count
; i
++) {
946 const char *snap_name
= snaps
[i
].name
;
948 sn_info
= sn_tab
+ i
;
949 pstrcpy(sn_info
->id_str
, sizeof(sn_info
->id_str
), snap_name
);
950 pstrcpy(sn_info
->name
, sizeof(sn_info
->name
), snap_name
);
952 sn_info
->vm_state_size
= snaps
[i
].size
;
953 sn_info
->date_sec
= 0;
954 sn_info
->date_nsec
= 0;
955 sn_info
->vm_clock_nsec
= 0;
957 rbd_snap_list_end(snaps
);
964 #ifdef LIBRBD_SUPPORTS_DISCARD
965 static BlockDriverAIOCB
* qemu_rbd_aio_discard(BlockDriverState
*bs
,
968 BlockDriverCompletionFunc
*cb
,
971 return rbd_start_aio(bs
, sector_num
, NULL
, nb_sectors
, cb
, opaque
,
976 static QEMUOptionParameter qemu_rbd_create_options
[] = {
978 .name
= BLOCK_OPT_SIZE
,
980 .help
= "Virtual disk size"
983 .name
= BLOCK_OPT_CLUSTER_SIZE
,
985 .help
= "RBD object size"
990 static BlockDriver bdrv_rbd
= {
991 .format_name
= "rbd",
992 .instance_size
= sizeof(BDRVRBDState
),
993 .bdrv_file_open
= qemu_rbd_open
,
994 .bdrv_close
= qemu_rbd_close
,
995 .bdrv_create
= qemu_rbd_create
,
996 .bdrv_get_info
= qemu_rbd_getinfo
,
997 .create_options
= qemu_rbd_create_options
,
998 .bdrv_getlength
= qemu_rbd_getlength
,
999 .bdrv_truncate
= qemu_rbd_truncate
,
1000 .protocol_name
= "rbd",
1002 .bdrv_aio_readv
= qemu_rbd_aio_readv
,
1003 .bdrv_aio_writev
= qemu_rbd_aio_writev
,
1005 #ifdef LIBRBD_SUPPORTS_AIO_FLUSH
1006 .bdrv_aio_flush
= qemu_rbd_aio_flush
,
1008 .bdrv_co_flush_to_disk
= qemu_rbd_co_flush
,
1011 #ifdef LIBRBD_SUPPORTS_DISCARD
1012 .bdrv_aio_discard
= qemu_rbd_aio_discard
,
1015 .bdrv_snapshot_create
= qemu_rbd_snap_create
,
1016 .bdrv_snapshot_delete
= qemu_rbd_snap_remove
,
1017 .bdrv_snapshot_list
= qemu_rbd_snap_list
,
1018 .bdrv_snapshot_goto
= qemu_rbd_snap_rollback
,
1021 static void bdrv_rbd_init(void)
1023 bdrv_register(&bdrv_rbd
);
1026 block_init(bdrv_rbd_init
);