All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wido den Hollander <wido@widodh.nl>
To: ceph-devel@vger.kernel.org
Subject: [Qemu] Passing config options to librados
Date: Tue, 15 Mar 2011 13:20:18 +0100	[thread overview]
Message-ID: <1300191618.2434.27.camel@wido-desktop> (raw)

Hi all,

While testing with Qemu-KVM and RBD I got:

Unable to find any monitors in the configuration file, because there is
no configuration file. Please specify monitors via -m monaddr or -c
ceph.conf
qemu-system-x86_64: -drive file=rbd:rbd/beta,format=rbd: error
connecting
qemu: could not open disk image rbd:rbd/beta: No such file or directory

Some searching through the source-code showed me that ceph.conf isn't
read by librados anymore, but you have to force this with
rados_conf_read_file

The current RBD code doesn't do this, thus leaving librados
unconfigured.

I'm using the patch below to force reading the ceph.conf, but imho that
is not flexible enough.

The current RBD code has no way of reading config options from Qemu and
converting them into librados options by rados_conf_set() nor specifying
a conf file to be read by rados_conf_read_file().

Something that still has to be implemented or am I missing something?

Wido


From 03cfbebf1363b89bca6c97beb90e30e04add5db9 Mon Sep 17 00:00:00 2001
From: Wido den Hollander <wido@widodh.nl>
Date: Tue, 15 Mar 2011 13:11:24 +0100
Subject: [PATCH] librados: Force reading ceph.conf


Signed-off-by: Wido den Hollander <wido@widodh.nl>
---
 block/rbd.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/block/rbd.c b/block/rbd.c
index f722cb4..7cd12f4 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -222,6 +222,11 @@ static int qemu_rbd_create(const char *filename,
QEMUOptionParameter *options)
         return -EIO;
     }
 
+    if (rados_conf_read_file(cluster, "/etc/ceph/ceph.conf") < 0) {
+        error_report("error reading configuration file");
+        return -EIO;
+    }
+
     if (rados_connect(cluster) < 0) {
         error_report("error connecting");
         rados_shutdown(cluster);
@@ -351,6 +356,11 @@ static int qemu_rbd_open(BlockDriverState *bs,
const char *filename, int flags)
         return r;
     }
 
+    if ((r = rados_conf_read_file(s->cluster, "/etc/ceph/ceph.conf")) <
0) {
+        error_report("error reading configuration file");
+        return r;
+    }
+
     if ((r = rados_connect(s->cluster)) < 0) {
         error_report("error connecting");
         rados_shutdown(s->cluster);
-- 
1.7.0.4


             reply	other threads:[~2011-03-15 12:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-15 12:20 Wido den Hollander [this message]
2011-03-15 21:37 ` [Qemu] Passing config options to librados Josh Durgin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1300191618.2434.27.camel@wido-desktop \
    --to=wido@widodh.nl \
    --cc=ceph-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.