Revision a9ccedc3
b/block/rbd.c | ||
---|---|---|
441 | 441 |
return (s->qemu_aio_count > 0); |
442 | 442 |
} |
443 | 443 |
|
444 |
static int qemu_rbd_open(BlockDriverState *bs, const char *filename, |
|
444 |
/* TODO Convert to fine grained options */ |
|
445 |
static QemuOptsList runtime_opts = { |
|
446 |
.name = "rbd", |
|
447 |
.head = QTAILQ_HEAD_INITIALIZER(runtime_opts.head), |
|
448 |
.desc = { |
|
449 |
{ |
|
450 |
.name = "filename", |
|
451 |
.type = QEMU_OPT_STRING, |
|
452 |
.help = "Specification of the rbd image", |
|
453 |
}, |
|
454 |
{ /* end of list */ } |
|
455 |
}, |
|
456 |
}; |
|
457 |
|
|
458 |
static int qemu_rbd_open(BlockDriverState *bs, const char *dummy, |
|
445 | 459 |
QDict *options, int flags) |
446 | 460 |
{ |
447 | 461 |
BDRVRBDState *s = bs->opaque; |
... | ... | |
450 | 464 |
char conf[RBD_MAX_CONF_SIZE]; |
451 | 465 |
char clientname_buf[RBD_MAX_CONF_SIZE]; |
452 | 466 |
char *clientname; |
467 |
QemuOpts *opts; |
|
468 |
Error *local_err = NULL; |
|
469 |
const char *filename; |
|
453 | 470 |
int r; |
454 | 471 |
|
472 |
opts = qemu_opts_create_nofail(&runtime_opts); |
|
473 |
qemu_opts_absorb_qdict(opts, options, &local_err); |
|
474 |
if (error_is_set(&local_err)) { |
|
475 |
qerror_report_err(local_err); |
|
476 |
error_free(local_err); |
|
477 |
qemu_opts_del(opts); |
|
478 |
return -EINVAL; |
|
479 |
} |
|
480 |
|
|
481 |
filename = qemu_opt_get(opts, "filename"); |
|
482 |
qemu_opts_del(opts); |
|
483 |
|
|
455 | 484 |
if (qemu_rbd_parsename(filename, pool, sizeof(pool), |
456 | 485 |
snap_buf, sizeof(snap_buf), |
457 | 486 |
s->name, sizeof(s->name), |
Also available in: Unified diff