Change in vdsm[ovirt-3.6]: virt: Add support for vgamem attribute
mzamazal at redhat.com
mzamazal at redhat.com
Tue Dec 15 10:31:21 UTC 2015
Hello Nir Soffer, Vinzenz Feenstra, Francesco Romani,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/50507
to review the following change.
Change subject: virt: Add support for vgamem attribute
......................................................................
virt: Add support for vgamem attribute
SPICE/QXL video RAM sizes are currently specified in <video> domain XML
element using the following attributes: ram, vram, vgamem. VDSM is
missing support for vgamem, this patch adds it.
Change-Id: Ic595761ef7195ec12830dd7f057471512b5c6355
Bug-Url: https://bugzilla.redhat.com/1275539
Signed-off-by: Milan Zamazal <mzamazal at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/50091
Continuous-Integration: Jenkins CI
Reviewed-by: Francesco Romani <fromani at redhat.com>
Reviewed-by: Nir Soffer <nsoffer at redhat.com>
Reviewed-by: Vinzenz Feenstra <vfeenstr at redhat.com>
Tested-by: Nir Soffer <nsoffer at redhat.com>
---
M tests/deviceTests.py
M vdsm/rpc/vdsmapi-schema.json
M vdsm/virt/vmdevices/core.py
3 files changed, 12 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/07/50507/1
diff --git a/tests/deviceTests.py b/tests/deviceTests.py
index a248277..977ec23 100644
--- a/tests/deviceTests.py
+++ b/tests/deviceTests.py
@@ -289,11 +289,11 @@
def testVideoXML(self):
videoXML = """
<video>
- <model heads="2" type="vga" vram="32768"/>
+ <model heads="2" type="vga" vgamem="8192" vram="32768"/>
</video>"""
- dev = {'device': 'vga', 'specParams': {'vram': '32768',
- 'heads': '2'}}
+ dev = {'device': 'vga',
+ 'specParams': {'vram': '32768', 'heads': '2', 'vgamem': '8192'}}
video = vmdevices.core.Video(self.conf, self.log, **dev)
self.assertXMLEqual(video.getXML().toxml(), videoXML)
diff --git a/vdsm/rpc/vdsmapi-schema.json b/vdsm/rpc/vdsmapi-schema.json
index ce0d7da..770434e 100644
--- a/vdsm/rpc/vdsmapi-schema.json
+++ b/vdsm/rpc/vdsmapi-schema.json
@@ -2941,15 +2941,19 @@
# for @qxl is the size of the secondary bar,
#
# @ram: #optional size of the primary bar for @qxl in KB,
-# not supported for 'cirrus'
+# rejected by libvirt for 'cirrus' or 'vga'
#
# @heads: #optional Specify the amount of monitors that will use single
# pci device. Currently relevant for @qxl devices only
#
+# @vgamem: #optional framebuffer size for @qxl in KB,
+# rejected by libvirt for 'cirrus' or 'vga'
+# (new in version 4.17.14)
+#
# Since: 4.10.0
##
{'type': 'VmVideoDeviceSpecParams',
- 'data': {'vram': 'uint', '*ram': 'uint','*heads': 'uint'}}
+ 'data': {'vram': 'uint', '*ram': 'uint', '*vgamem': 'uint', '*heads': 'uint'}}
##
# @VmVideoDevice:
diff --git a/vdsm/virt/vmdevices/core.py b/vdsm/virt/vmdevices/core.py
index 8b18986..1db577a 100644
--- a/vdsm/virt/vmdevices/core.py
+++ b/vdsm/virt/vmdevices/core.py
@@ -290,8 +290,9 @@
video = self.createXmlElem('video', None, ['address'])
sourceAttrs = {'vram': self.specParams.get('vram', '32768'),
'heads': self.specParams.get('heads', '1')}
- if 'ram' in self.specParams:
- sourceAttrs['ram'] = self.specParams['ram']
+ for attr in ('ram', 'vgamem',):
+ if attr in self.specParams:
+ sourceAttrs[attr] = self.specParams[attr]
video.appendChildWithArgs('model', type=self.device, **sourceAttrs)
return video
--
To view, visit https://gerrit.ovirt.org/50507
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic595761ef7195ec12830dd7f057471512b5c6355
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Milan Zamazal <mzamazal at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
More information about the vdsm-patches
mailing list