From: Fiona Ebner <f.ebner@proxmox.com>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, armbru@redhat.com, eblake@redhat.com,
hreitz@redhat.com, kwolf@redhat.com, pl@dlhnet.de,
idryomov@gmail.com
Subject: [PATCH 2/2] block/rbd: support keyring option via QAPI
Date: Thu, 15 May 2025 13:29:08 +0200 [thread overview]
Message-ID: <20250515112908.383693-3-f.ebner@proxmox.com> (raw)
In-Reply-To: <20250515112908.383693-1-f.ebner@proxmox.com>
In Proxmox VE, it is not always required to have a dedicated Ceph
configuration file, and using the 'key-secret' QAPI option would
require obtaining a key from the keyring first. The keyring location
is readily available however, so having support for the 'keyring'
configuration option is most convenient.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
block/rbd.c | 8 ++++++++
qapi/block-core.json | 5 ++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/block/rbd.c b/block/rbd.c
index 2924f23093..660224c6c8 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -306,6 +306,14 @@ static int qemu_rbd_set_key_value_pairs(rados_t cluster,
return 0;
}
+ if (key_value_pairs->keyring) {
+ int r = rados_conf_set(cluster, "keyring", key_value_pairs->keyring);
+ if (r < 0) {
+ error_setg_errno(errp, -r, "could not set 'keyring'");
+ return -EINVAL;
+ }
+ }
+
if (key_value_pairs->has_rbd_cache_policy) {
RbdCachePolicy value = key_value_pairs->rbd_cache_policy;
int r = rados_conf_set(cluster, "rbd_cache_policy",
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 4666765e66..3253c6e6e9 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -4327,12 +4327,15 @@
#
# Key-value pairs for Ceph configuration.
#
+# @keyring: Ceph configuration option 'keyring'.
+#
# @rbd-cache-policy: Ceph configuration option 'rbd_cache_policy'.
#
# Since 10.1
##
{ 'struct': 'RbdKeyValuePairs',
- 'data': { '*rbd-cache-policy': 'RbdCachePolicy' } }
+ 'data': { '*keyring': 'str',
+ '*rbd-cache-policy': 'RbdCachePolicy' } }
##
# @BlockdevOptionsRbd:
--
2.39.5
next prev parent reply other threads:[~2025-05-15 11:30 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-15 11:29 [PATCH 0/2] block/rbd: support selected key-value-pairs via QAPI Fiona Ebner
2025-05-15 11:29 ` [PATCH 1/2] " Fiona Ebner
2025-06-16 9:25 ` Ilya Dryomov
2025-06-16 9:52 ` Daniel P. Berrangé
2025-06-16 10:28 ` Ilya Dryomov
2025-06-16 12:38 ` Fiona Ebner
2025-06-19 18:38 ` Ilya Dryomov
2025-06-19 21:20 ` Ilya Dryomov
2025-06-20 8:18 ` Fiona Ebner
2025-06-16 12:29 ` Fiona Ebner
2025-06-16 12:34 ` Daniel P. Berrangé
2025-06-16 9:41 ` Daniel P. Berrangé
2025-05-15 11:29 ` Fiona Ebner [this message]
2025-06-16 9:34 ` [PATCH 2/2] block/rbd: support keyring option " Ilya Dryomov
2025-06-16 12:51 ` Fiona Ebner
2025-06-19 18:56 ` Ilya Dryomov
2025-06-05 13:36 ` [PATCH 0/2] block/rbd: support selected key-value-pairs " Fiona Ebner
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=20250515112908.383693-3-f.ebner@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=hreitz@redhat.com \
--cc=idryomov@gmail.com \
--cc=kwolf@redhat.com \
--cc=pl@dlhnet.de \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).