[virt-tools-list] [PATCH virt-manager 1/2] virt-manager: reset vgamem for video when changing device type
Giuseppe Scrivano
gscrivan at redhat.com
Mon Dec 1 15:42:53 UTC 2014
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1169295
Signed-off-by: Giuseppe Scrivano <gscrivan at redhat.com>
---
tests/xmlparse-xml/change-videos-out.xml | 2 +-
tests/xmlparse.py | 1 +
virtManager/domain.py | 1 +
virtinst/devicevideo.py | 4 ++--
4 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/tests/xmlparse-xml/change-videos-out.xml b/tests/xmlparse-xml/change-videos-out.xml
index ea357ef..15cb0b0 100644
--- a/tests/xmlparse-xml/change-videos-out.xml
+++ b/tests/xmlparse-xml/change-videos-out.xml
@@ -30,7 +30,7 @@
<model type="vmvga" heads="5"/>
</video>
<video>
- <model type="qxl" ram="100"/>
+ <model type="qxl" vgamem="8192" ram="100"/>
</video>
</devices>
</domain>
diff --git a/tests/xmlparse.py b/tests/xmlparse.py
index 62aa410..50ae630 100644
--- a/tests/xmlparse.py
+++ b/tests/xmlparse.py
@@ -628,6 +628,7 @@ class XMLParseTest(unittest.TestCase):
check = self._make_checker(dev3)
check("model", "cirrus", "cirrus", "qxl")
check("ram", None, 100)
+ check("vgamem", None, 8192)
self._alter_compare(guest.get_xml_config(), outfile)
diff --git a/virtManager/domain.py b/virtManager/domain.py
index b786fef..2d4afcb 100644
--- a/virtManager/domain.py
+++ b/virtManager/domain.py
@@ -860,6 +860,7 @@ class vmmDomain(vmmLibvirtObject):
editdev.vram = None
editdev.heads = None
editdev.ram = None
+ editdev.vgamem = None
return self._redefine_device(change, devobj, use_live_device)
diff --git a/virtinst/devicevideo.py b/virtinst/devicevideo.py
index 088c9ad..1d8ee10 100644
--- a/virtinst/devicevideo.py
+++ b/virtinst/devicevideo.py
@@ -35,14 +35,14 @@ class VirtualVideoDevice(VirtualDevice):
return model.upper()
return model.capitalize()
-
- _XML_PROP_ORDER = ["model", "vram", "heads"]
+ _XML_PROP_ORDER = ["model", "vram", "heads", "vgamem"]
model = XMLProperty("./model/@type",
default_cb=lambda s: "cirrus",
default_name=MODEL_DEFAULT)
vram = XMLProperty("./model/@vram", is_int=True)
ram = XMLProperty("./model/@ram", is_int=True)
heads = XMLProperty("./model/@heads", is_int=True)
+ vgamem = XMLProperty("./model/@vgamem", is_int=True)
VirtualVideoDevice.register_type()
--
1.9.3
More information about the virt-tools-list
mailing list