storage_backend_rbd.c 19.6 KB
Newer Older
1 2 3
/*
 * storage_backend_rbd.c: storage backend for RBD (RADOS Block Device) handling
 *
4
 * Copyright (C) 2013-2014 Red Hat, Inc.
5 6 7 8 9 10 11 12 13 14 15 16 17
 * Copyright (C) 2012 Wido den Hollander
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
18
 * License along with this library.  If not, see
O
Osier Yang 已提交
19
 * <http://www.gnu.org/licenses/>.
20 21 22 23 24 25
 *
 * Author: Wido den Hollander <wido@widodh.nl>
 */

#include <config.h>

26
#include "datatypes.h"
27
#include "virerror.h"
28 29
#include "storage_backend_rbd.h"
#include "storage_conf.h"
30
#include "viralloc.h"
31
#include "virlog.h"
32
#include "base64.h"
33
#include "viruuid.h"
34
#include "virstring.h"
35 36 37 38 39
#include "rados/librados.h"
#include "rbd/librbd.h"

#define VIR_FROM_THIS VIR_FROM_STORAGE

40 41
VIR_LOG_INIT("storage.storage_backend_rbd");

42 43 44 45 46 47 48
struct _virStorageBackendRBDState {
    rados_t cluster;
    rados_ioctx_t ioctx;
    time_t starttime;
};

typedef struct _virStorageBackendRBDState virStorageBackendRBDState;
E
Eric Blake 已提交
49
typedef virStorageBackendRBDState *virStorageBackendRBDStatePtr;
50

E
Eric Blake 已提交
51
static int virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDStatePtr ptr,
52 53 54 55
                                             virConnectPtr conn,
                                             virStoragePoolObjPtr pool)
{
    int ret = -1;
56
    int r = 0;
57 58 59 60 61 62
    unsigned char *secret_value = NULL;
    size_t secret_value_size;
    char *rados_key = NULL;
    virBuffer mon_host = VIR_BUFFER_INITIALIZER;
    virSecretPtr secret = NULL;
    char secretUuid[VIR_UUID_STRING_BUFLEN];
63
    size_t i;
64
    char *mon_buff = NULL;
65 66 67
    const char *client_mount_timeout = "30";
    const char *mon_op_timeout = "30";
    const char *osd_op_timeout = "30";
68 69 70 71 72 73

    VIR_DEBUG("Found Cephx username: %s",
              pool->def->source.auth.cephx.username);

    if (pool->def->source.auth.cephx.username != NULL) {
        VIR_DEBUG("Using cephx authorization");
74 75 76
        r = rados_create(&ptr->cluster, pool->def->source.auth.cephx.username);
        if (r < 0) {
            virReportSystemError(-r, "%s", _("failed to initialize RADOS"));
77 78 79
            goto cleanup;
        }

80 81 82 83 84 85 86
        if (!conn) {
            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                           _("'ceph' authentication not supported "
                             "for autostarted pools"));
            return -1;
        }

87
        if (pool->def->source.auth.cephx.secret.uuidUsable) {
88 89 90
            virUUIDFormat(pool->def->source.auth.cephx.secret.uuid, secretUuid);
            VIR_DEBUG("Looking up secret by UUID: %s", secretUuid);
            secret = virSecretLookupByUUIDString(conn, secretUuid);
91
        } else if (pool->def->source.auth.cephx.secret.usage != NULL) {
92 93 94 95 96 97 98
            VIR_DEBUG("Looking up secret by usage: %s",
                      pool->def->source.auth.cephx.secret.usage);
            secret = virSecretLookupByUsage(conn, VIR_SECRET_USAGE_TYPE_CEPH,
                                            pool->def->source.auth.cephx.secret.usage);
        }

        if (secret == NULL) {
99 100 101
            if (pool->def->source.auth.cephx.secret.uuidUsable) {
                virReportError(VIR_ERR_NO_SECRET,
                               _("no secret matches uuid '%s'"),
102
                                 secretUuid);
103 104 105 106 107
            } else {
                virReportError(VIR_ERR_NO_SECRET,
                               _("no secret matches usage value '%s'"),
                                 pool->def->source.auth.cephx.secret.usage);
            }
108 109 110
            goto cleanup;
        }

111 112 113 114
        secret_value = conn->secretDriver->secretGetValue(secret, &secret_value_size, 0,
                                                          VIR_SECRET_GET_VALUE_INTERNAL_CALL);

        if (!secret_value) {
115 116 117 118 119
            if (pool->def->source.auth.cephx.secret.uuidUsable) {
                virReportError(VIR_ERR_INTERNAL_ERROR,
                               _("could not get the value of the secret "
                                 "for username '%s' using uuid '%s'"),
                               pool->def->source.auth.cephx.username,
120
                               secretUuid);
121 122 123 124 125 126 127
            } else {
                virReportError(VIR_ERR_INTERNAL_ERROR,
                               _("could not get the value of the secret "
                                 "for username '%s' using usage value '%s'"),
                               pool->def->source.auth.cephx.username,
                               pool->def->source.auth.cephx.secret.usage);
            }
128 129 130
            goto cleanup;
        }

131 132 133 134 135
        base64_encode_alloc((char *)secret_value,
                            secret_value_size, &rados_key);
        memset(secret_value, 0, secret_value_size);

        if (rados_key == NULL) {
136
            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
137
                           _("failed to decode the RADOS key"));
138 139 140 141 142
            goto cleanup;
        }

        VIR_DEBUG("Found cephx key: %s", rados_key);
        if (rados_conf_set(ptr->cluster, "key", rados_key) < 0) {
143 144 145
            virReportError(VIR_ERR_INTERNAL_ERROR,
                           _("failed to set RADOS option: %s"),
                           "rados_key");
146 147 148 149 150 151
            goto cleanup;
        }

        memset(rados_key, 0, strlen(rados_key));

        if (rados_conf_set(ptr->cluster, "auth_supported", "cephx") < 0) {
152 153 154
            virReportError(VIR_ERR_INTERNAL_ERROR,
                           _("failed to set RADOS option: %s"),
                           "auth_supported");
155 156 157 158 159
            goto cleanup;
        }
    } else {
        VIR_DEBUG("Not using cephx authorization");
        if (rados_create(&ptr->cluster, NULL) < 0) {
160
            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
161
                           _("failed to create the RADOS cluster"));
162 163 164
            goto cleanup;
        }
        if (rados_conf_set(ptr->cluster, "auth_supported", "none") < 0) {
165 166 167
            virReportError(VIR_ERR_INTERNAL_ERROR,
                           _("failed to set RADOS option: %s"),
                           "auth_supported");
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
            goto cleanup;
        }
    }

    VIR_DEBUG("Found %zu RADOS cluster monitors in the pool configuration",
              pool->def->source.nhost);

    for (i = 0; i < pool->def->source.nhost; i++) {
        if (pool->def->source.hosts[i].name != NULL &&
            !pool->def->source.hosts[i].port) {
            virBufferAsprintf(&mon_host, "%s:6789,",
                              pool->def->source.hosts[i].name);
        } else if (pool->def->source.hosts[i].name != NULL &&
            pool->def->source.hosts[i].port) {
            virBufferAsprintf(&mon_host, "%s:%d,",
                              pool->def->source.hosts[i].name,
                              pool->def->source.hosts[i].port);
        } else {
186 187
            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                           _("received malformed monitor, check the XML definition"));
188 189 190 191 192 193 194 195 196 197 198
        }
    }

    if (virBufferError(&mon_host)) {
       virReportOOMError();
       goto cleanup;
    }

    mon_buff = virBufferContentAndReset(&mon_host);
    VIR_DEBUG("RADOS mon_host has been set to: %s", mon_buff);
    if (rados_conf_set(ptr->cluster, "mon_host", mon_buff) < 0) {
J
Ján Tomko 已提交
199 200 201
        virReportError(VIR_ERR_INTERNAL_ERROR,
                       _("failed to set RADOS option: %s"),
                       "mon_host");
202 203 204
        goto cleanup;
    }

205 206 207 208 209 210 211 212 213 214 215 216 217 218
    /*
     * Set timeout options for librados.
     * In case the Ceph cluster is down libvirt won't block forever.
     * Operations in librados will return -ETIMEDOUT when the timeout is reached.
     */
    VIR_DEBUG("Setting RADOS option client_mount_timeout to %s", client_mount_timeout);
    rados_conf_set(ptr->cluster, "client_mount_timeout", client_mount_timeout);

    VIR_DEBUG("Setting RADOS option rados_mon_op_timeout to %s", mon_op_timeout);
    rados_conf_set(ptr->cluster, "rados_mon_op_timeout", mon_op_timeout);

    VIR_DEBUG("Setting RADOS option rados_osd_op_timeout to %s", osd_op_timeout);
    rados_conf_set(ptr->cluster, "rados_osd_op_timeout", osd_op_timeout);

219
    ptr->starttime = time(0);
220 221 222 223
    r = rados_connect(ptr->cluster);
    if (r < 0) {
        virReportSystemError(-r, _("failed to connect to the RADOS monitor on: %s"),
                             mon_buff);
224 225 226 227 228
        goto cleanup;
    }

    ret = 0;

229
 cleanup:
230 231
    VIR_FREE(secret_value);
    VIR_FREE(rados_key);
232 233 234 235

    if (secret != NULL)
        virSecretFree(secret);

236 237 238 239 240
    virBufferFreeAndReset(&mon_host);
    VIR_FREE(mon_buff);
    return ret;
}

241 242 243 244 245 246 247 248 249 250
static int virStorageBackendRBDOpenIoCTX(virStorageBackendRBDStatePtr ptr, virStoragePoolObjPtr pool)
{
    int r = rados_ioctx_create(ptr->cluster, pool->def->source.name, &ptr->ioctx);
    if (r < 0) {
        virReportSystemError(-r, _("failed to create the RBD IoCTX. Does the pool '%s' exist?"),
                             pool->def->source.name);
    }
    return r;
}

251 252 253 254
static int virStorageBackendRBDCloseRADOSConn(virStorageBackendRBDStatePtr ptr)
{
    int ret = 0;

E
Eric Blake 已提交
255
    if (ptr->ioctx != NULL) {
256
        VIR_DEBUG("Closing RADOS IoCTX");
E
Eric Blake 已提交
257
        rados_ioctx_destroy(ptr->ioctx);
258 259
        ret = -1;
    }
E
Eric Blake 已提交
260
    ptr->ioctx = NULL;
261

E
Eric Blake 已提交
262
    if (ptr->cluster != NULL) {
263
        VIR_DEBUG("Closing RADOS connection");
E
Eric Blake 已提交
264
        rados_shutdown(ptr->cluster);
265 266
        ret = -2;
    }
E
Eric Blake 已提交
267
    ptr->cluster = NULL;
268

E
Eric Blake 已提交
269
    time_t runtime = time(0) - ptr->starttime;
270 271 272 273 274 275 276 277 278 279
    VIR_DEBUG("RADOS connection existed for %ld seconds", runtime);

    return ret;
}

static int volStorageBackendRBDRefreshVolInfo(virStorageVolDefPtr vol,
                                              virStoragePoolObjPtr pool,
                                              virStorageBackendRBDStatePtr ptr)
{
    int ret = -1;
280
    int r = 0;
281
    rbd_image_t image;
282 283 284 285 286

    r = rbd_open(ptr->ioctx, vol->name, &image, NULL);
    if (r < 0) {
        virReportSystemError(-r, _("failed to open the RBD image '%s'"),
                             vol->name);
287 288 289 290
        return ret;
    }

    rbd_image_info_t info;
291 292 293 294
    r = rbd_stat(image, &info, sizeof(info));
    if (r < 0) {
        virReportSystemError(-r, _("failed to stat the RBD image '%s'"),
                             vol->name);
295 296 297 298 299 300 301 302
        goto cleanup;
    }

    VIR_DEBUG("Refreshed RBD image %s/%s (size: %llu obj_size: %llu num_objs: %llu)",
              pool->def->source.name, vol->name, (unsigned long long)info.size,
              (unsigned long long)info.obj_size,
              (unsigned long long)info.num_objs);

303 304
    vol->target.capacity = info.size;
    vol->target.allocation = info.obj_size * info.num_objs;
305 306 307
    vol->type = VIR_STORAGE_VOL_NETWORK;

    VIR_FREE(vol->target.path);
308
    if (virAsprintf(&vol->target.path, "%s/%s",
309
                    pool->def->source.name,
310
                    vol->name) == -1)
311 312 313 314 315
        goto cleanup;

    VIR_FREE(vol->key);
    if (virAsprintf(&vol->key, "%s/%s",
                    pool->def->source.name,
316
                    vol->name) == -1)
317 318 319 320
        goto cleanup;

    ret = 0;

321
 cleanup:
322 323 324 325
    rbd_close(image);
    return ret;
}

326
static int virStorageBackendRBDRefreshPool(virConnectPtr conn,
327 328 329 330 331
                                           virStoragePoolObjPtr pool)
{
    size_t max_size = 1024;
    int ret = -1;
    int len = -1;
332
    int r = 0;
333
    char *name, *names = NULL;
E
Eric Blake 已提交
334
    virStorageBackendRBDState ptr;
335 336 337 338 339 340 341
    ptr.cluster = NULL;
    ptr.ioctx = NULL;

    if (virStorageBackendRBDOpenRADOSConn(&ptr, conn, pool) < 0) {
        goto cleanup;
    }

342
    if (virStorageBackendRBDOpenIoCTX(&ptr, pool) < 0) {
343 344 345
        goto cleanup;
    }

346
    struct rados_cluster_stat_t clusterstat;
347 348 349
    r = rados_cluster_stat(ptr.cluster, &clusterstat);
    if (r < 0) {
        virReportSystemError(-r, "%s", _("failed to stat the RADOS cluster"));
350 351 352 353
        goto cleanup;
    }

    struct rados_pool_stat_t poolstat;
354 355 356 357
    r = rados_ioctx_pool_stat(ptr.ioctx, &poolstat);
    if (r < 0) {
        virReportSystemError(-r, _("failed to stat the RADOS pool '%s'"),
                             pool->def->source.name);
358 359 360
        goto cleanup;
    }

361 362
    pool->def->capacity = clusterstat.kb * 1024;
    pool->def->available = clusterstat.kb_avail * 1024;
363 364 365
    pool->def->allocation = poolstat.num_bytes;

    VIR_DEBUG("Utilization of RBD pool %s: (kb: %llu kb_avail: %llu num_bytes: %llu)",
366 367
              pool->def->source.name, (unsigned long long)clusterstat.kb,
              (unsigned long long)clusterstat.kb_avail,
368 369 370 371
              (unsigned long long)poolstat.num_bytes);

    while (true) {
        if (VIR_ALLOC_N(names, max_size) < 0)
372
            goto cleanup;
373 374 375 376 377

        len = rbd_list(ptr.ioctx, names, &max_size);
        if (len >= 0)
            break;
        if (len != -ERANGE) {
J
Ján Tomko 已提交
378
            VIR_WARN("%s", _("A problem occurred while listing RBD images"));
379 380
            goto cleanup;
        }
381
        VIR_FREE(names);
382 383
    }

384
    for (name = names; name < names + max_size;) {
385 386 387 388 389
        virStorageVolDefPtr vol;

        if (STREQ(name, ""))
            break;

390
        if (VIR_ALLOC(vol) < 0)
391
            goto cleanup;
392

393
        if (VIR_STRDUP(vol->name, name) < 0) {
394
            VIR_FREE(vol);
395
            goto cleanup;
396
        }
397 398 399

        name += strlen(name) + 1;

E
Eric Blake 已提交
400
        if (volStorageBackendRBDRefreshVolInfo(vol, pool, &ptr) < 0) {
401
            virStorageVolDefFree(vol);
402
            goto cleanup;
403
        }
404

405
        if (VIR_APPEND_ELEMENT(pool->volumes.objs, pool->volumes.count, vol) < 0) {
406
            virStorageVolDefFree(vol);
407 408 409
            virStoragePoolObjClearVols(pool);
            goto cleanup;
        }
410 411
    }

412
    VIR_DEBUG("Found %zu images in RBD pool %s",
413 414 415 416
              pool->volumes.count, pool->def->source.name);

    ret = 0;

417
 cleanup:
418
    VIR_FREE(names);
E
Eric Blake 已提交
419
    virStorageBackendRBDCloseRADOSConn(&ptr);
420 421 422 423 424 425 426 427 428
    return ret;
}

static int virStorageBackendRBDDeleteVol(virConnectPtr conn,
                                         virStoragePoolObjPtr pool,
                                         virStorageVolDefPtr vol,
                                         unsigned int flags)
{
    int ret = -1;
429
    int r = 0;
E
Eric Blake 已提交
430
    virStorageBackendRBDState ptr;
431 432 433 434 435 436 437 438 439 440 441 442 443
    ptr.cluster = NULL;
    ptr.ioctx = NULL;

    VIR_DEBUG("Removing RBD image %s/%s", pool->def->source.name, vol->name);

    if (flags & VIR_STORAGE_VOL_DELETE_ZEROED) {
        VIR_WARN("%s", _("This storage backend does not supported zeroed removal of volumes"));
    }

    if (virStorageBackendRBDOpenRADOSConn(&ptr, conn, pool) < 0) {
        goto cleanup;
    }

444
    if (virStorageBackendRBDOpenIoCTX(&ptr, pool) < 0) {
445 446 447
        goto cleanup;
    }

448 449 450 451
    r = rbd_remove(ptr.ioctx, vol->name);
    if (r < 0) {
        virReportSystemError(-r, _("failed to remove volume '%s/%s'"),
                             pool->def->source.name, vol->name);
452 453 454 455 456
        goto cleanup;
    }

    ret = 0;

457
 cleanup:
E
Eric Blake 已提交
458
    virStorageBackendRBDCloseRADOSConn(&ptr);
459 460 461
    return ret;
}

462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484

static int
virStorageBackendRBDCreateVol(virConnectPtr conn ATTRIBUTE_UNUSED,
                              virStoragePoolObjPtr pool,
                              virStorageVolDefPtr vol)
{
    vol->type = VIR_STORAGE_VOL_NETWORK;

    VIR_FREE(vol->target.path);
    if (virAsprintf(&vol->target.path, "%s/%s",
                    pool->def->source.name,
                    vol->name) == -1)
        return -1;

    VIR_FREE(vol->key);
    if (virAsprintf(&vol->key, "%s/%s",
                    pool->def->source.name,
                    vol->name) == -1)
        return -1;

    return 0;
}

485 486 487 488 489 490 491 492 493 494
static int virStorageBackendRBDCreateImage(rados_ioctx_t io,
                                           char *name, long capacity)
{
    int order = 0;
#if LIBRBD_VERSION_CODE > 260
    uint64_t features = 3;
    uint64_t stripe_count = 1;
    uint64_t stripe_unit = 4194304;

    if (rbd_create3(io, name, capacity, features, &order,
495
                    stripe_unit, stripe_count) < 0) {
496 497 498 499 500 501 502 503
#else
    if (rbd_create(io, name, capacity, &order) < 0) {
#endif
        return -1;
    }

    return 0;
}
504 505 506 507 508 509

static int
virStorageBackendRBDBuildVol(virConnectPtr conn,
                             virStoragePoolObjPtr pool,
                             virStorageVolDefPtr vol,
                             unsigned int flags)
510
{
E
Eric Blake 已提交
511
    virStorageBackendRBDState ptr;
512 513 514
    ptr.cluster = NULL;
    ptr.ioctx = NULL;
    int ret = -1;
515
    int r = 0;
516 517 518

    VIR_DEBUG("Creating RBD image %s/%s with size %llu",
              pool->def->source.name,
519
              vol->name, vol->target.capacity);
520

521 522 523
    virCheckFlags(0, -1);

    if (virStorageBackendRBDOpenRADOSConn(&ptr, conn, pool) < 0)
524 525
        goto cleanup;

526
    if (virStorageBackendRBDOpenIoCTX(&ptr, pool) < 0)
527 528 529
        goto cleanup;

    if (vol->target.encryption != NULL) {
530 531
        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                       _("storage pool does not support encrypted volumes"));
532 533 534
        goto cleanup;
    }

535 536
    r = virStorageBackendRBDCreateImage(ptr.ioctx, vol->name,
                                        vol->target.capacity);
537 538 539 540
    if (r < 0) {
        virReportSystemError(-r, _("failed to create volume '%s/%s'"),
                             pool->def->source.name,
                             vol->name);
541 542 543
        goto cleanup;
    }

544
    if (volStorageBackendRBDRefreshVolInfo(vol, pool, &ptr) < 0)
545 546 547 548
        goto cleanup;

    ret = 0;

549
 cleanup:
E
Eric Blake 已提交
550
    virStorageBackendRBDCloseRADOSConn(&ptr);
551 552 553 554 555 556 557
    return ret;
}

static int virStorageBackendRBDRefreshVol(virConnectPtr conn,
                                          virStoragePoolObjPtr pool ATTRIBUTE_UNUSED,
                                          virStorageVolDefPtr vol)
{
E
Eric Blake 已提交
558
    virStorageBackendRBDState ptr;
559 560 561 562 563 564 565 566
    ptr.cluster = NULL;
    ptr.ioctx = NULL;
    int ret = -1;

    if (virStorageBackendRBDOpenRADOSConn(&ptr, conn, pool) < 0) {
        goto cleanup;
    }

567
    if (virStorageBackendRBDOpenIoCTX(&ptr, pool) < 0) {
568 569 570
        goto cleanup;
    }

E
Eric Blake 已提交
571
    if (volStorageBackendRBDRefreshVolInfo(vol, pool, &ptr) < 0) {
572 573 574 575 576
        goto cleanup;
    }

    ret = 0;

577
 cleanup:
E
Eric Blake 已提交
578
    virStorageBackendRBDCloseRADOSConn(&ptr);
579 580 581 582 583 584 585 586 587
    return ret;
}

static int virStorageBackendRBDResizeVol(virConnectPtr conn ATTRIBUTE_UNUSED,
                                     virStoragePoolObjPtr pool ATTRIBUTE_UNUSED,
                                     virStorageVolDefPtr vol,
                                     unsigned long long capacity,
                                     unsigned int flags)
{
E
Eric Blake 已提交
588
    virStorageBackendRBDState ptr;
589 590 591 592
    ptr.cluster = NULL;
    ptr.ioctx = NULL;
    rbd_image_t image = NULL;
    int ret = -1;
593
    int r = 0;
594 595 596 597 598 599 600

    virCheckFlags(0, -1);

    if (virStorageBackendRBDOpenRADOSConn(&ptr, conn, pool) < 0) {
        goto cleanup;
    }

601
    if (virStorageBackendRBDOpenIoCTX(&ptr, pool) < 0) {
602 603 604
        goto cleanup;
    }

605 606 607 608
    r = rbd_open(ptr.ioctx, vol->name, &image, NULL);
    if (r < 0) {
       virReportSystemError(-r, _("failed to open the RBD image '%s'"),
                            vol->name);
609 610 611
       goto cleanup;
    }

612 613 614 615
    r = rbd_resize(image, capacity);
    if (r < 0) {
        virReportSystemError(-r, _("failed to resize the RBD image '%s'"),
                             vol->name);
616 617 618 619 620
        goto cleanup;
    }

    ret = 0;

621
 cleanup:
622 623
    if (image != NULL)
       rbd_close(image);
E
Eric Blake 已提交
624
    virStorageBackendRBDCloseRADOSConn(&ptr);
625 626 627 628 629 630 631 632
    return ret;
}

virStorageBackend virStorageBackendRBD = {
    .type = VIR_STORAGE_POOL_RBD,

    .refreshPool = virStorageBackendRBDRefreshPool,
    .createVol = virStorageBackendRBDCreateVol,
633
    .buildVol = virStorageBackendRBDBuildVol,
634 635 636 637
    .refreshVol = virStorageBackendRBDRefreshVol,
    .deleteVol = virStorageBackendRBDDeleteVol,
    .resizeVol = virStorageBackendRBDResizeVol,
};