Shahar Havivi has uploaded a new change for review.
Change subject: vdsm: add support for ram/vram on QXL device
......................................................................
vdsm: add support for ram/vram on QXL device
setting support for qxl device with proper ram/vram attributes:
1 Monitor, Single PCI checked 64MB 32MB
2 Monitors, Single PCI checked 132MB 32MB
4 Monitors, Single PCI checked 256MB 32MB
Change-Id: I71cc51acf22dbce66373009f0c6ec8e2022a4f87
Bug-Url:
https://bugzilla.redhat.com/787578
Signed-off-by: Shahar Havivi <shaharh(a)redhat.com>
---
M tests/vmTests.py
M vdsm/vm.py
M vdsm_api/vdsmapi-schema.json
3 files changed, 12 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/61/19361/1
diff --git a/tests/vmTests.py b/tests/vmTests.py
index b0675be..9aa9792 100644
--- a/tests/vmTests.py
+++ b/tests/vmTests.py
@@ -275,10 +275,10 @@
def testVideoXML(self):
videoXML = """
<video>
- <model heads="2" type="vga"
vram="8192"/>
+ <model heads="2" type="vga" vram="32768"
ram="131072"/>
</video>"""
- dev = {'device': 'vga', 'specParams': {'vram':
'8192', 'heads': '2'}}
+ dev = {'device': 'vga', 'specParams': {'vram':
'32768', 'ram': '65536' 'heads': '2'}}
video = vm.VideoDevice(self.conf, self.log, **dev)
self.assertXML(video.getXML(), videoXML)
diff --git a/vdsm/vm.py b/vdsm/vm.py
index 92d274e..b378834 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -1211,10 +1211,15 @@
Create domxml for video device
"""
video = self.createXmlElem('video', None, ['address'])
- video.appendChildWithArgs('model', type=self.device,
- vram=self.specParams['vram'],
- heads=self.specParams.get('heads',
'1'))
-
+ if 'ram' in self.specParams:
+ video.appendChildWithArgs('model', type=self.device,
+ vram=self.specParams.get('vram',
'32768'),
+ ram=self.specParams.get('ram',
'65536'),
+ heads=self.specParams.get('heads',
'1'))
+ else:
+ video.appendChildWithArgs('model', type=self.device,
+ vram=self.specParams.get('vram',
'32768'),
+ heads=self.specParams.get('heads',
'1'))
return video
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index 27c12c1..f1a21ed 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -2238,7 +2238,7 @@
#
# Since: 4.10.0
##
-{'type': 'VmVideoDeviceSpecParams', 'data': {'vram':
'uint', '*heads': 'uint'}}
+{'type': 'VmVideoDeviceSpecParams', 'data': {'vram':
'uint', 'ram': 'uint', '*heads': 'uint'}}
##
# @VmVideoDevice:
--
To view, visit
http://gerrit.ovirt.org/19361
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I71cc51acf22dbce66373009f0c6ec8e2022a4f87
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi <shavivi(a)redhat.com>