Merge branch 'wip-lmy-rados' of https://github.com/liangmingyuanneo/fio
authorJens Axboe <axboe@kernel.dk>
Sun, 29 May 2022 15:32:18 +0000 (09:32 -0600)
committerJens Axboe <axboe@kernel.dk>
Sun, 29 May 2022 15:32:18 +0000 (09:32 -0600)
* 'wip-lmy-rados' of https://github.com/liangmingyuanneo/fio:
  engines/ceph: add option for setting config file path

HOWTO.rst
engines/rados.c
examples/rados.fio
fio.1

index 58d02fa24c89cce5e1f6f1a9bf39c4c39dde99b8..8ab3ac4bf709473af30131352275d856991ae0f9 100644 (file)
--- a/HOWTO.rst
+++ b/HOWTO.rst
@@ -2495,6 +2495,11 @@ with the caveat that when used on the command line, they must come after the
        the full *type.id* string. If no type. prefix is given, fio will add
        'client.' by default.
 
+.. option:: conf=str : [rados]
+
+    Specifies the configuration path of ceph cluster, so conf file does not
+    have to be /etc/ceph/ceph.conf.
+
 .. option:: busy_poll=bool : [rbd,rados]
 
         Poll store instead of waiting for completion. Usually this provides better
index 976f9229b082723e2a67ebc70fe53d43aa7e111c..d0d15c5b54c8380353b56e8b9856a8475a1b9b25 100644 (file)
@@ -37,6 +37,7 @@ struct rados_options {
        char *cluster_name;
        char *pool_name;
        char *client_name;
+       char *conf;
        int busy_poll;
        int touch_objects;
 };
@@ -69,6 +70,16 @@ static struct fio_option options[] = {
                .category = FIO_OPT_C_ENGINE,
                .group    = FIO_OPT_G_RBD,
        },
+       {
+               .name     = "conf",
+               .lname    = "ceph configuration file path",
+               .type     = FIO_OPT_STR_STORE,
+               .help     = "Path of the ceph configuration file",
+               .off1     = offsetof(struct rados_options, conf),
+               .def      = "/etc/ceph/ceph.conf",
+               .category = FIO_OPT_C_ENGINE,
+               .group    = FIO_OPT_G_RBD,
+       },
        {
                .name     = "busy_poll",
                .lname    = "busy poll mode",
@@ -184,7 +195,7 @@ static int _fio_rados_connect(struct thread_data *td)
                goto failed_early;
        }
 
-       r = rados_conf_read_file(rados->cluster, NULL);
+       r = rados_conf_read_file(rados->cluster, o->conf);
        if (r < 0) {
                log_err("rados_conf_read_file failed.\n");
                goto failed_early;
index 035cbff4ab1481172f7e90ac0a6554d56ca0aed6..dd86f354c8173479969b677ae9247c55ef747b82 100644 (file)
@@ -14,6 +14,7 @@
 ioengine=rados
 clientname=admin
 pool=rados
+conf=/etc/ceph/ceph.conf
 busy_poll=0
 rw=randwrite
 bs=4k
diff --git a/fio.1 b/fio.1
index 5f0575742cc91c3eef542a7fe49f0c8fecf03940..bdba314277a6e002d67845c668d95f45896ea0ab 100644 (file)
--- a/fio.1
+++ b/fio.1
@@ -2244,6 +2244,10 @@ Ceph cluster. If the \fBclustername\fR is specified, the \fBclientname\fR shall
 the full *type.id* string. If no type. prefix is given, fio will add 'client.'
 by default.
 .TP
+.BI (rados)conf \fR=\fPstr
+Specifies the configuration path of ceph cluster, so conf file does not
+have to be /etc/ceph/ceph.conf.
+.TP
 .BI (rbd,rados)busy_poll \fR=\fPbool
 Poll store instead of waiting for completion. Usually this provides better
 throughput at cost of higher(up to 100%) CPU utilization.