diff --git a/lib/fog/libvirt/requests/compute/list_volumes.rb b/lib/fog/libvirt/requests/compute/list_volumes.rb index 5eef3d24a..01751f734 100644 --- a/lib/fog/libvirt/requests/compute/list_volumes.rb +++ b/lib/fog/libvirt/requests/compute/list_volumes.rb @@ -34,11 +34,15 @@ module Fog :path => vol.path, :name => vol.name, :format_type => format_type, - :allocation => vol.info.allocation, - :capacity => vol.info.capacity, + :allocation => bytes_to_gb(vol.info.allocation), + :capacity => bytes_to_gb(vol.info.capacity), } end + def bytes_to_gb bytes + bytes / 1024**3 + end + def raw_volumes client.list_storage_pools.each do |pool_name| pool = client.lookup_storage_pool_by_name(pool_name)