[libvirt] [PATCH] rbd: Do not append Ceph monitor port number 6789 if not provided

Wido den Hollander wido at widodh.nl
Mon Dec 28 15:33:26 UTC 2015


If no port number was provided for a storage pool libvirt would default
to port 6789.

librbd/librados will however already default to 6789 when no port number
is provided.

In the future Ceph will however switch to a new port for the Ceph monitors
since port 6789 is already assigned to a different application by IANA.

Port 6789 is assigned to SMC-HTTPS and Ceph now has port 3300 assigned as
the 'Ceph monitor' port.

In this case it is the best solution to not hardcode any port number into
libvirt and let librados handle the connection.

Only if a user specifies a different port number we pass it down to librados,
otherwise we leave it blank.

Signed-off-by: Wido den Hollander <wido at widodh.nl>
---
 src/storage/storage_backend_rbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
index cdbfdee..df4a3d3 100644
--- a/src/storage/storage_backend_rbd.c
+++ b/src/storage/storage_backend_rbd.c
@@ -173,7 +173,7 @@ static int virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDStatePtr ptr,
     for (i = 0; i < source->nhost; i++) {
         if (source->hosts[i].name != NULL &&
             !source->hosts[i].port) {
-            virBufferAsprintf(&mon_host, "%s:6789,",
+            virBufferAsprintf(&mon_host, "%s,",
                               source->hosts[i].name);
         } else if (source->hosts[i].name != NULL &&
             source->hosts[i].port) {
-- 
1.9.1




More information about the libvir-list mailing list