diff --git a/src/components/storagePools/storagePool.jsx b/src/components/storagePools/storagePool.jsx index e81bd2917..3809ae267 100644 --- a/src/components/storagePools/storagePool.jsx +++ b/src/components/storagePools/storagePool.jsx @@ -48,11 +48,11 @@ export const getStoragePoolRow = ({ storagePool, vms, onAddErrorNotification }) { storagePool.name } ); - const allocation = parseFloat(convertToUnit(storagePool.allocation, units.B, units.GiB).toFixed(2)); + const physical = parseFloat(convertToUnit(storagePool.physical, units.B, units.GiB).toFixed(2)); const capacity = parseFloat(convertToUnit(storagePool.capacity, units.B, units.GiB).toFixed(2)); - const sizeLabel = String(cockpit.format("$0 / $1 GiB", allocation, capacity)); + const sizeLabel = String(cockpit.format("$0 / $1 GiB", physical, capacity)); const size = ( - { - const allocation = parseFloat(convertToUnit(volume.allocation, units.B, units.GiB).toFixed(2)); + const physical = parseFloat(convertToUnit(volume.physical, units.B, units.GiB).toFixed(2)); const capacity = parseFloat(convertToUnit(volume.capacity, units.B, units.GiB).toFixed(2)); const columns = [ { title:
{volume.name}
}, { title:
{(isVolumeUsed[volume.name] || []).join(', ')}
, }, - { title:
{`${allocation} / ${capacity} GB`}
}, + { title:
{`${physical} / ${capacity} GB`}
}, ]; return { columns, selected: volume.selected, props: { key: volume.name } }; }); diff --git a/src/components/vm/disks/vmDisksCard.jsx b/src/components/vm/disks/vmDisksCard.jsx index 0690dd16b..95f925db8 100644 --- a/src/components/vm/disks/vmDisksCard.jsx +++ b/src/components/vm/disks/vmDisksCard.jsx @@ -94,7 +94,7 @@ export class VmDisksCardLibvirt extends React.Component { if (!vm.disks[target] || (vm.disks[target].type !== 'volume' && !vm.disksStats[target])) { return false; // not yet retrieved, can't decide about disk stats support } - return vm.disks[target].type == 'volume' || !isNaN(vm.disksStats[target].capacity) || !isNaN(vm.disksStats[target].allocation); + return vm.disks[target].type == 'volume' || !isNaN(vm.disksStats[target].capacity) || !isNaN(vm.disksStats[target].physical); }); } @@ -104,11 +104,11 @@ export class VmDisksCardLibvirt extends React.Component { prepareDiskData(disk, diskStats, idPrefix, storagePools) { diskStats = diskStats || {}; - let used = diskStats.allocation; + let used = diskStats.physical; let capacity = diskStats.capacity; /* - * For disks of type `volume` allocation and capacity stats are not + * For disks of type `volume` physical and capacity stats are not * fetched with the virConnectGetAllDomainStats API so we need to get * them from the volume. * @@ -125,7 +125,7 @@ export class VmDisksCardLibvirt extends React.Component { if (volume) { capacity = volume.capacity; - used = volume.allocation; + used = volume.physical; } } diff --git a/src/libvirt-xml-parse.js b/src/libvirt-xml-parse.js index 74492abc0..bb05eada0 100644 --- a/src/libvirt-xml-parse.js +++ b/src/libvirt-xml-parse.js @@ -1086,6 +1086,8 @@ export function parseStoragePoolDumpxml(connectionName, storagePoolXml, objPath) result.capacity = storagePoolElem.getElementsByTagName('capacity')[0].childNodes[0].nodeValue; result.available = storagePoolElem.getElementsByTagName('available')[0].childNodes[0].nodeValue; result.allocation = storagePoolElem.getElementsByTagName('allocation')[0].childNodes[0].nodeValue; + const physicalElem = storagePoolElem.getElementsByTagName('physical')[0]; + result.physical = physicalElem ? physicalElem.childNodes[0].nodeValue : NaN; // Fetch path property if target is contained for this type of pool if (['dir', 'fs', 'netfs', 'logical', 'disk', 'iscsi', 'scsi', 'mpath', 'zfs'].indexOf(result.type) > -1) {