Ceph RBD Connection

2021-05-22 Thread Mr. Gecko

Hello,

I setup a Ceph Cluster on my system in hopes of using it with libvirtd, 
however I'm finding myself unable to have libvirtd make the connection.


[root@server ~]# virsh pool-start "${CEPH_POOL}"
error: Failed to start pool libvirt-pool
error: failed to connect to the RADOS monitor on: localhost:6789,: No 
such file or directory


I know that rbd is working as I am able to use it with the rbd utility.

[root@server ~]# rbd list libvirt-pool
Kolab
[root@server ~]# rbd device map libvirt-pool/Kolab
/dev/rbd0
[root@server ~]# lsblk /dev/rbd0
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
rbd0 253:0    0  20G  0 disk
├─rbd0p1 253:1    0   1G  0 part
└─rbd0p2 253:2    0  19G  0 part

The libvirtd logs are not providing any useful information on the issue, 
I tried changing log-level to 1 and enabling the log_filters/adding 
"1:rbd" to the log filters.


I have tried both the libvirt version 7.3.0 in my repository and the 
bleeding edge with a compile from git. Both returns the same error.


Any help in troubleshooting this issue? I'm somewhat new when it comes 
to all of this.


Thank you,

James Coleman



Re: [libvirt PATCH v2 2/2] storage_file: add support to probe cluster_size from QCOW2 images

2021-05-22 Thread John Ferlan




On 5/20/21 11:14 AM, Pavel Hrdina wrote:

From QEMU docs/interop/qcow2.txt :


Byte  20 - 23:   cluster_bits
 Number of bits that are used for addressing an offset
 within a cluster (1 << cluster_bits is the cluster size).

With this patch libvirt will be able to report the current cluster_size
for all existing storage volumes managed by storage driver.

Signed-off-by: Pavel Hrdina 
---

Changes in v2:
 - Reworkded to use callback.

  src/storage/storage_util.c|  3 ++
  src/storage_file/storage_file_probe.c | 70 ---
  2 files changed, 56 insertions(+), 17 deletions(-)



[...]

  
+static unsigned long long

+qcow2GetClusterSize(const char *buf,
+size_t buf_size,
+int endian)
+{
+int clusterBits = 0;
+
+if ((QCOWX_HDR_CLUSTER_BITS_OFFSET + 4) > buf_size)
+return 0;
+
+if (endian == LV_LITTLE_ENDIAN)
+clusterBits = virReadBufInt32LE(buf + QCOWX_HDR_CLUSTER_BITS_OFFSET);
+else
+clusterBits = virReadBufInt32BE(buf + QCOWX_HDR_CLUSTER_BITS_OFFSET);
+
+if (clusterBits > 0)
+return 1 << clusterBits;
+


Coverity showed me a new error today: OVERFLOW_BEFORE_WIDEN

1) Event overflow_before_widen:	Potentially overflowing expression "1 << 
clusterBits" with type "int" (32 bits, signed) is evaluated using 32-bit 
arithmetic, and then used in a context that expects an expression of 
type "unsigned long long" (64 bits, unsigned).
(2) Event remediation:	To avoid overflow, cast "1" to type "unsigned 
long long".



John



+return 0;
+}
+
+


[...]