Change in vdsm[master]: virt: graphdev: support multiple graphics devices
fromani at redhat.com
fromani at redhat.com
Tue Apr 29 15:37:29 UTC 2014
Francesco Romani has uploaded a new change for review.
Change subject: virt: graphdev: support multiple graphics devices
......................................................................
virt: graphdev: support multiple graphics devices
This patch allows a Vm to have more than one Graphics Devices.
Change-Id: I5be348b342359d42c878937dca27454fe206a35a
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M vdsm/virt/vm.py
M vdsm_api/vdsmapi-schema.json
2 files changed, 37 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/15/27215/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 6563f68..c5c8daa 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -1816,8 +1816,16 @@
if len(devices[device]) > 1:
raise ValueError("only a single %s device is "
"supported" % device)
- if len(devices[GRAPHICS_DEVICES]) != 1:
- raise ValueError("graphics device is required")
+ graphDevs = set()
+ for dev in devices[GRAPHICS_DEVICES]:
+ if dev.device not in graphDevs:
+ graphDevs.add(dev.device)
+ else:
+ raise ValueError("only a single graphic device "
+ "per type is supported")
+ if not graphDevs:
+ raise ValueError("at least one graphics device is required")
+
def getConfController(self):
"""
@@ -2576,7 +2584,10 @@
stats['displayType'] = 'qxl'
return stats
+ # backward compatibility
stats.update(getInfo(self.getConfGraphics()[0]))
+ stats['graphicDevices'] = [getInfo(dev, legacy=False)
+ for dev in self.getConfGraphics()]
def isMigrating(self):
return self._migrationSourceThread.isAlive()
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index 5836f1d..57a78e1 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -5825,6 +5825,25 @@
'balloon_target': 'str'}}
##
+# @GraphicsDeviceInfo:
+#
+# Graphics Device information.
+#
+# @displayPort: The port in use for unencrypted display data
+#
+# @displaySecurePort: The port in use for encrypted display data
+#
+# @displayType: The type of display in use
+#
+# @displayIp: The IP address to use for accessing the VM display
+#
+# Since: 4.15.0
+##
+{'type': 'GraphicsDeviceInfo',
+ 'data': {'displayPort': 'uint', 'displaySecurePort': 'uint',
+ 'displayType': 'VmGraphicsDeviceType', 'displayIp': 'str'}}
+
+##
# @GuestMountInfo:
#
# Information about a mounted filesystem as reported by the guest agent.
@@ -6001,6 +6020,9 @@
# @guestCPUCount: The number of CPU cores are visible as online on the
# guest OS. This value is -1 if not supported to report
#
+# @graphicDevices: Graphics device informations.
+# (new in version 4.15.0)
+#
# Since: 4.10.0
##
{'type': 'RunningVmStats',
@@ -6020,7 +6042,8 @@
'disksUsage': ['GuestMountInfo'],
'netIfaces': ['GuestNetworkDeviceInfo'],
'*watchdogEvent': 'WatchdogEvent', 'guestFQDN': 'str',
- '*migrationProgress': 'uint', 'guestCPUCount': 'int'}}
+ '*migrationProgress': 'uint', 'guestCPUCount': 'int',
+ 'graphicDevices': ['GraphicsDeviceInfo']}}
##
# @VmStats:
--
To view, visit http://gerrit.ovirt.org/27215
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5be348b342359d42c878937dca27454fe206a35a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
More information about the vdsm-patches
mailing list