[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[virt-tools-list] [virt-manager PATCH] Don't use ram parameter for any other graphics than qxl



Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=920549
---
 virtinst/VirtualVideoDevice.py | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/virtinst/VirtualVideoDevice.py b/virtinst/VirtualVideoDevice.py
index e92ca31..3463337 100644
--- a/virtinst/VirtualVideoDevice.py
+++ b/virtinst/VirtualVideoDevice.py
@@ -1,5 +1,5 @@
 #
-# Copyright 2009  Red Hat, Inc.
+# Copyright 2009, 2013  Red Hat, Inc.
 # Cole Robinson <crobinso redhat com>
 #
 # This program is free software; you can redistribute it and/or modify
@@ -41,6 +41,7 @@ class VirtualVideoDevice(VirtualDevice):

         self._model_type    = None
         self._vram          = None
+        self._ram           = None
         self._heads         = None

         if self._is_parse():
@@ -56,6 +57,11 @@ class VirtualVideoDevice(VirtualDevice):
         return self._model_type
     def set_model_type(self, val):
         self._model_type = val
+        # 'ram' attribute is only supported for qxl devices and
+        # libvirt reports error when the attribute appears in the xml
+        # for some other model
+        if val != "qxl":
+            self.ram = None
     model_type = _xml_property(get_model_type, set_model_type,
                                xpath="./model/@type")

@@ -69,6 +75,13 @@ class VirtualVideoDevice(VirtualDevice):
                         xpath="./model/@ram")


+    def get_ram(self):
+        return self._ram
+    def set_ram(self, val):
+        self._ram = val
+    ram = _xml_property(get_ram, set_ram,
+                        xpath="./model/@ram")
+
     def get_heads(self):
         return self._heads
     def set_heads(self, val):
-- 
1.8.2.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]