mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +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,13 +540,14 @@ static void
|
|||||||
virNodeDeviceCapStorageDefFormatBlocksize(virBuffer *buf,
|
virNodeDeviceCapStorageDefFormatBlocksize(virBuffer *buf,
|
||||||
const virNodeDevCapData *data)
|
const virNodeDevCapData *data)
|
||||||
{
|
{
|
||||||
if (data->storage.logical_block_size > 0)
|
if (data->storage.logical_block_size == 0 &&
|
||||||
virBufferAsprintf(buf, "<logical_block_size>%llu</logical_block_size>\n",
|
data->storage.num_blocks == 0)
|
||||||
data->storage.logical_block_size);
|
return;
|
||||||
|
|
||||||
if (data->storage.num_blocks > 0)
|
virBufferAsprintf(buf, "<logical_block_size>%llu</logical_block_size>\n",
|
||||||
virBufferAsprintf(buf, "<num_blocks>%llu</num_blocks>\n",
|
data->storage.logical_block_size);
|
||||||
data->storage.num_blocks);
|
virBufferAsprintf(buf, "<num_blocks>%llu</num_blocks>\n",
|
||||||
|
data->storage.num_blocks);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user