mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
virNodeDeviceCapStorageDefFormatBlocksize: Report sector size and count together
Report both block count and size together when either one of them is present equivalently to what the schema type 'blockData' in 'schemas/nodedev.rng' defines. Resolves: https://issues.redhat.com/browse/RHEL-18165 Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
9f855b149a
commit
06e344f762
@ -540,11 +540,12 @@ static void
|
||||
virNodeDeviceCapStorageDefFormatBlocksize(virBuffer *buf,
|
||||
const virNodeDevCapData *data)
|
||||
{
|
||||
if (data->storage.logical_block_size > 0)
|
||||
if (data->storage.logical_block_size == 0 &&
|
||||
data->storage.num_blocks == 0)
|
||||
return;
|
||||
|
||||
virBufferAsprintf(buf, "<logical_block_size>%llu</logical_block_size>\n",
|
||||
data->storage.logical_block_size);
|
||||
|
||||
if (data->storage.num_blocks > 0)
|
||||
virBufferAsprintf(buf, "<num_blocks>%llu</num_blocks>\n",
|
||||
data->storage.num_blocks);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user