iallocator: extract storage info directly from node info

So far, the iallocator made a node info RPC call, converted
the result into a legacy node info format and then extracted
the storage information from that. This patch removes the
middle step of this procedure, skipping the legacy node info
usage.

In later patches, we will completely eliminate the need for
the legacy node info in iallocator.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
iallocator: factor out instance memory summation

The iallocator adjusts the free memory by a calculation
of how much memory is actually currently used by instances
on the node. This calculation is rather complicated and
deserves its own function to increase testability. No
functional changes in this patch otherwise.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
iallocator: get rid of MakeLegacyNodeInfo

So far, the iallocator makes a node info call, converts
the result into a legacy node info structure and then
retrieves various values from it. This patch removes
the call to MakeLegacyNodeInfo completely, by letting the
consumers of the hypervisor info part of the result
retrieve that part from the result of the node info call
directly.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
iallocator: storage processing accepts space_info structure

This is a small refactoring to make the processing of
the storage space information not accept a node info
result, but the more specific space info structure instead.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>