resync: "Adds RemoteFX support to the Hyper-V driver"

(cherry-picked from commit a39710244a8f26b0d9d80bffa41c04c84b133f17)

Change-Id: I873053f7e16941ad7b272693ece8b69e49fc7c18
This commit is contained in:
Claudiu Belu
2016-07-05 19:19:54 +03:00
parent 9d4a327cca
commit aaa7b676cb
5 changed files with 183 additions and 183 deletions

View File

@@ -138,20 +138,20 @@ class HostOps(object):
return objects.NUMATopology(cells=cells)
def _get_remotefx_gpu_info(self):
remotefx_total_video_ram = 0
remotefx_available_video_ram = 0
total_video_ram = 0
available_video_ram = 0
if CONF.hyperv.enable_remotefx:
gpus = self._hostutils.get_remotefx_gpu_info()
for gpu in gpus:
remotefx_total_video_ram += int(gpu['total_video_ram'])
remotefx_available_video_ram += int(gpu['available_video_ram'])
total_video_ram += int(gpu['total_video_ram'])
available_video_ram += int(gpu['available_video_ram'])
else:
gpus = []
return {'remotefx_total_video_ram': remotefx_total_video_ram,
'remotefx_available_video_ram': remotefx_available_video_ram,
'remotefx_gpu_info': jsonutils.dumps(gpus)}
return {'total_video_ram': total_video_ram,
'used_video_ram': total_video_ram - available_video_ram,
'gpu_info': jsonutils.dumps(gpus)}
def get_available_resource(self):
"""Retrieve resource info.
@@ -178,8 +178,6 @@ class HostOps(object):
cpu_topology['cores'] *
cpu_topology['threads'])
gpu_info = self._get_remotefx_gpu_info()
dic = {'vcpus': vcpus,
'memory_mb': total_mem_mb,
'memory_mb_used': used_mem_mb,
@@ -194,6 +192,8 @@ class HostOps(object):
[(arch.I686, hv_type.HYPERV, vm_mode.HVM),
(arch.X86_64, hv_type.HYPERV, vm_mode.HVM)],
}
gpu_info = self._get_remotefx_gpu_info()
dic.update(gpu_info)
numa_topology = self._get_host_numa_topology()