~ubuntu-branches/ubuntu/quantal/virtinst/quantal-proposed

« back to all changes in this revision

Viewing changes to virtinst/VirtualVideoDevice.py

  • Committer: Bazaar Package Importer
  • Author(s): Marc Deslauriers
  • Date: 2011-02-01 15:40:11 UTC
  • mfrom: (1.3.16 experimental)
  • Revision ID: james.westby@ubuntu.com-20110201154011-op0nusgc240xajvb
Tags: 0.500.5-1ubuntu1
* Merge from debian experimental. Remaining changes:
  - debian/patches/9001_Ubuntu.patch:
     + Updated to add maverick and natty to OS list and enable virtio
       for them.
  - debian/patches/9003-fix-path-to-hvmloader-in-testsuite.patch: adjust
    testsuite for 0001-fix-path-to-hvmloader.patch and
    0002-Fix-path-to-pygrub.patch. (refreshed)
  - debian/control: added acl package to depends.
  - Demote virt-viewer to Suggests, as it's in universe.
  - Recommends libvirt-bin
* Removed patches:
  - debian/patches/9002-libvirt_disk_format.patch: Upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
# MA 02110-1301 USA.
19
19
 
20
20
import VirtualDevice
 
21
from XMLBuilderDomain import _xml_property
21
22
 
22
23
class VirtualVideoDevice(VirtualDevice.VirtualDevice):
23
24
 
25
26
 
26
27
    # Default models list
27
28
    MODEL_DEFAULT = "default"
28
 
    _model_types = [ "cirrus", "vga", "vmvga", "xen", MODEL_DEFAULT]
29
 
 
30
 
    def __init__(self, conn):
31
 
        VirtualDevice.VirtualDevice.__init__(self, conn=conn)
32
 
 
33
 
        self._model_type    = self.MODEL_DEFAULT
 
29
    _model_types = [ "cirrus", "vga", "vmvga", "xen", "qxl", MODEL_DEFAULT]
 
30
 
 
31
    def __init__(self, conn, parsexml=None, parsexmlnode=None, caps=None):
 
32
        VirtualDevice.VirtualDevice.__init__(self, conn,
 
33
                                             parsexml, parsexmlnode, caps)
 
34
 
 
35
        self._model_type    = None
34
36
        self._vram          = None
35
37
        self._heads         = None
36
38
 
 
39
        if self._is_parse():
 
40
            return
 
41
 
 
42
        self.model_type = self.MODEL_DEFAULT
 
43
 
37
44
    def get_model_types(self):
38
45
        return self._model_types[:]
39
46
    model_types = property(get_model_types)
42
49
        return self._model_type
43
50
    def set_model_type(self, val):
44
51
        self._model_type = val
45
 
    model_type = property(get_model_type, set_model_type)
 
52
    model_type = _xml_property(get_model_type, set_model_type,
 
53
                               xpath="./model/@type")
46
54
 
47
55
    def get_vram(self):
48
56
        return self._vram
49
57
    def set_vram(self, val):
50
58
        self._vram = val
51
 
    vram = property(get_vram, set_vram)
 
59
    vram = _xml_property(get_vram, set_vram,
 
60
                         xpath="./model/@vram")
52
61
 
53
62
    def get_heads(self):
54
63
        return self._heads
55
64
    def set_heads(self, val):
56
65
        self._heads = val
57
 
    heads = property(get_heads, set_heads)
 
66
    heads = _xml_property(get_heads, set_heads,
 
67
                          xpath="./model/@heads")
58
68
 
59
 
    def get_xml_config(self):
 
69
    def _get_xml_config(self):
60
70
        model = self.model_type
61
71
        if self.model_type == self.MODEL_DEFAULT:
62
72
            model = "cirrus"