open-iscsi / rtslib-fb

Python library for configuring the Linux kernel-based multiprotocol SCSI target (LIO)
Apache License 2.0
73 stars 90 forks source link

report the correct size for partitions #140

Closed maurizio-lombardi closed 6 years ago

maurizio-lombardi commented 6 years ago

If you use a partition instead of the whole device as the backstore device, rtslib will always report its size as 0 bytes.

This happens because rtslib tries to read the "queue/logical_block_size" attribute, which can only be found in the parent's node. This patch fixes the bug by loading the parent node's attributes if it detects that the device is a partition.

Signed-off-by: Maurizio Lombardi mlombard@redhat.com

maurizio-lombardi commented 6 years ago

@mikechristie looks good to you?