Example #1
0
        def __init__(self, virsh_instance=base.base.virsh):
            accessors.XMLAttribute(property_name="backend_model",
                                   libvirtxml=self,
                                   forbidden=None,
                                   parent_xpath='/',
                                   tag_name='backend',
                                   attribute='model')
            accessors.XMLAttribute(property_name="backend_type",
                                   libvirtxml=self,
                                   forbidden=None,
                                   parent_xpath='/',
                                   tag_name='backend',
                                   attribute='type')
            accessors.XMLElementText('backend_dev',
                                     self, parent_xpath='/',
                                     tag_name='backend')

            accessors.XMLElementList(property_name='source',
                                     libvirtxml=self,
                                     parent_xpath='/',
                                     marshal_from=self.marshal_from_source,
                                     marshal_to=self.marshal_to_source)
            accessors.XMLAttribute(property_name="backend_protocol",
                                   libvirtxml=self,
                                   forbidden=None,
                                   parent_xpath='/',
                                   tag_name='protocol',
                                   attribute='type')
            super(self.__class__, self).__init__(virsh_instance=virsh_instance)
            self.xml = '<backend/>'
Example #2
0
 def __init__(self, virsh_instance=base.virsh):
     accessors.XMLElementText('name', self, parent_xpath='/',
                              tag_name='name')
     accessors.XMLElementText('parent', self, parent_xpath='/',
                              tag_name='parent')
     accessors.XMLAttribute('cap_type', self, parent_xpath='/',
                            tag_name='capability', attribute='type')
     accessors.XMLElementText('host', self, parent_xpath='/capability',
                              tag_name='host')
     accessors.XMLAttribute('fc_type', self, parent_xpath='/capability',
                            tag_name='capability', attribute='type')
     accessors.XMLAttribute('max_count', self, parent_xpath='/capability',
                            tag_name='capability', attribute='maxCount')
     accessors.XMLElementText('wwnn', self,
                              parent_xpath='/capability/capability',
                              tag_name='wwnn')
     accessors.XMLElementText('wwpn', self,
                              parent_xpath='/capability/capability',
                              tag_name='wwpn')
     accessors.XMLElementText('fabric_wwn', self,
                              parent_xpath='/capability/capability',
                              tag_name='fabric_wwn')
     accessors.XMLElementText('path', self, parent_xpath='/',
                              tag_name='path')
     accessors.XMLElementText('driver_name', self,
                              parent_xpath='/driver',
                              tag_name='name')
     super(NodedevXMLBase, self).__init__(virsh_instance=virsh_instance)
     self.xml = '<device></device>'
Example #3
0
 def __init__(self, type_name='vnc', virsh_instance=base.base.virsh):
     # Add additional attribute 'passwd' for security
     accessors.XMLAttribute('passwd',
                            self,
                            parent_xpath='/',
                            tag_name='graphics',
                            attribute='passwd')
     accessors.XMLAttribute('autoport',
                            self,
                            parent_xpath='/',
                            tag_name='graphics',
                            attribute='autoport')
     accessors.XMLAttribute('port',
                            self,
                            parent_xpath='/',
                            tag_name='graphics',
                            attribute='port')
     accessors.XMLAttribute('tlsPort',
                            self,
                            parent_xpath='/',
                            tag_name='graphics',
                            attribute='tlsPort')
     super(Graphics, self).__init__(device_tag='graphics',
                                    type_name=type_name,
                                    virsh_instance=virsh_instance)
Example #4
0
        def __init__(self, virsh_instance=base.base.virsh):
            accessors.XMLAttribute('type',
                                   self,
                                   parent_xpath='/',
                                   tag_name='backingStore',
                                   attribute='type')
            accessors.XMLAttribute('index',
                                   self,
                                   parent_xpath='/',
                                   tag_name='backingStore',
                                   attribute='index')
            accessors.XMLElementDict('format',
                                     self,
                                     parent_xpath='/',
                                     tag_name='format')
            accessors.XMLElementNest(
                'source',
                self,
                parent_xpath='/',
                tag_name='source',
                subclass=self.Source,
                subclass_dargs={'virsh_instance': virsh_instance})

            super(self.__class__, self).__init__(virsh_instance=virsh_instance)
            self.xml = '<backingStore><backingStore/></backingStore>'
Example #5
0
 def __init__(self,
              virsh_instance=base.base.virsh,
              reservations_managed=""):
     accessors.XMLAttribute('reservations_managed',
                            self,
                            parent_xpath='/',
                            tag_name='reservations',
                            attribute='managed')
     accessors.XMLAttribute('reservations_source_type',
                            self,
                            parent_xpath='/',
                            tag_name='source',
                            attribute='type')
     accessors.XMLAttribute('reservations_source_path',
                            self,
                            parent_xpath='/',
                            tag_name='source',
                            attribute='path')
     accessors.XMLAttribute('reservations_source_mode',
                            self,
                            parent_xpath='/',
                            tag_name='source',
                            attribute='mode')
     super(self.__class__, self).__init__(virsh_instance=virsh_instance)
     self.xml = '<reservations/>'
Example #6
0
 def __init__(self, virsh_instance=base.virsh):
     accessors.XMLElementInt('domain', self, parent_xpath='/',
                             tag_name='domain')
     accessors.XMLElementInt('bus', self, parent_xpath='/',
                             tag_name='bus')
     accessors.XMLElementInt('slot', self, parent_xpath='/',
                             tag_name='slot')
     accessors.XMLElementInt('function', self, parent_xpath='/',
                             tag_name='function')
     accessors.XMLAttribute('product_id', self, parent_xpath='/',
                            tag_name='product', attribute='id')
     accessors.XMLAttribute('vendor_id', self, parent_xpath='/',
                            tag_name='vendor', attribute='id')
     accessors.XMLAttribute('numa_node', self, parent_xpath='/',
                            tag_name='numa', attribute='node')
     accessors.XMLAttribute('iommuGroup_number', self, parent_xpath='/',
                            tag_name='iommuGroup', attribute='number')
     accessors.XMLElementList('iommuGroup_address', self,
                              parent_xpath='/iommuGroup',
                              marshal_from=self.marshal_from_address,
                              marshal_to=self.marshal_to_address)
     accessors.XMLElementList('virt_functions', self,
                              parent_xpath='/capability',
                              marshal_from=self.marshal_from_address,
                              marshal_to=self.marshal_to_address)
     accessors.XMLElementText('product_info', self, parent_xpath='/',
                              tag_name='product')
     super(PCIXML, self).__init__(virsh_instance=virsh_instance)
     self.xml = (' <capability type=\'pci\'></capability>')
Example #7
0
 def __init__(self, virsh_instance=base.base.virsh):
     accessors.XMLElementInt('size',
                             self,
                             parent_xpath='/',
                             tag_name='size')
     accessors.XMLAttribute(property_name="size_unit",
                            libvirtxml=self,
                            forbidden=None,
                            parent_xpath='/',
                            tag_name='size',
                            attribute='unit')
     accessors.XMLElementInt('requested_size',
                             self,
                             parent_xpath='/',
                             tag_name='requested')
     accessors.XMLAttribute(property_name="requested_unit",
                            libvirtxml=self,
                            forbidden=None,
                            parent_xpath='/',
                            tag_name='requested',
                            attribute='unit')
     accessors.XMLElementInt('current_size',
                             self,
                             parent_xpath='/',
                             tag_name='current')
     accessors.XMLAttribute(property_name="current_unit",
                            libvirtxml=self,
                            forbidden=None,
                            parent_xpath='/',
                            tag_name='current',
                            attribute='unit')
     accessors.XMLElementInt('block_size',
                             self,
                             parent_xpath='/',
                             tag_name='block')
     accessors.XMLAttribute(property_name="block_unit",
                            libvirtxml=self,
                            forbidden=None,
                            parent_xpath='/',
                            tag_name='block',
                            attribute='unit')
     accessors.XMLElementInt('node',
                             self,
                             parent_xpath='/',
                             tag_name='node')
     accessors.XMLElementNest(
         'label',
         self,
         parent_xpath='/',
         tag_name='label',
         subclass=self.Label,
         subclass_dargs={'virsh_instance': virsh_instance})
     accessors.XMLElementBool('readonly',
                              self,
                              parent_xpath='/',
                              tag_name='readonly')
     super(self.__class__, self).__init__(virsh_instance=virsh_instance)
     self.xml = '<target/>'
Example #8
0
 def __init__(self, type_name, virsh_instance=base.base.virsh):
     super(Controller, self).__init__(device_tag='controller',
                                      type_name=type_name,
                                      virsh_instance=virsh_instance)
     accessors.XMLAttribute('type',
                            self,
                            parent_xpath='/',
                            tag_name='controller',
                            attribute='type')
     accessors.XMLAttribute('index',
                            self,
                            parent_xpath='/',
                            tag_name='controller',
                            attribute='index')
     accessors.XMLAttribute('model',
                            self,
                            parent_xpath='/',
                            tag_name='controller',
                            attribute='model')
     accessors.XMLAttribute('ports',
                            self,
                            parent_xpath='/',
                            tag_name='controller',
                            attribute='ports')
     accessors.XMLAttribute('vectors',
                            self,
                            parent_xpath='/',
                            tag_name='controller',
                            attribute='vectors')
     accessors.XMLElementText('pcihole64',
                              self,
                              parent_xpath='/',
                              tag_name='pcihole64')
     accessors.XMLElementDict('driver',
                              self,
                              parent_xpath='/',
                              tag_name='driver')
     accessors.XMLElementNest('address',
                              self,
                              parent_xpath='/',
                              tag_name='address',
                              subclass=self.Address,
                              subclass_dargs={
                                  'type_name': 'pci',
                                  'virsh_instance': virsh_instance
                              })
     accessors.XMLElementDict('target',
                              self,
                              parent_xpath='/',
                              tag_name='target')
     accessors.XMLElementDict('alias',
                              self,
                              parent_xpath='/',
                              tag_name='alias')
     accessors.XMLElementDict('model_name',
                              self,
                              parent_xpath='/',
                              tag_name='model')
Example #9
0
 def __init__(self, virsh_instance=base.base.virsh, auth_user=""):
     accessors.XMLAttribute('slice_type', self, parent_xpath='/',
                            tag_name='slice', attribute='type')
     accessors.XMLAttribute('slice_offset', self, parent_xpath='/',
                            tag_name='slice', attribute='offset')
     accessors.XMLAttribute('slice_size', self, parent_xpath='/',
                            tag_name='slice', attribute='size')
     super(self.__class__, self).__init__(virsh_instance=virsh_instance)
     self.xml = '<slices/>'
Example #10
0
 def __init__(self, virsh_instance=base.virsh):
     accessors.XMLAttribute(property_name="hypervisor_type",
                            libvirtxml=self,
                            forbidden=None,
                            parent_xpath='/',
                            tag_name='domain',
                            attribute='type')
     accessors.XMLElementText(property_name="vm_name",
                              libvirtxml=self,
                              forbidden=None,
                              parent_xpath='/',
                              tag_name='name')
     accessors.XMLElementText(property_name="uuid",
                              libvirtxml=self,
                              forbidden=None,
                              parent_xpath='/',
                              tag_name='uuid')
     accessors.XMLElementInt(property_name="vcpu",
                             libvirtxml=self,
                             forbidden=None,
                             parent_xpath='/',
                             tag_name='vcpu')
     accessors.XMLAttribute(property_name="placement",
                            libvirtxml=self,
                            forbidden=None,
                            parent_xpath='/',
                            tag_name='vcpu',
                            attribute='placement')
     accessors.XMLElementInt(property_name="max_mem",
                             libvirtxml=self,
                             forbidden=None,
                             parent_xpath='/',
                             tag_name='memory')
     accessors.XMLElementInt(property_name="current_mem",
                             libvirtxml=self,
                             forbidden=None,
                             parent_xpath='/',
                             tag_name='currentMemory')
     accessors.XMLElementDict(property_name="numa",
                              libvirtxml=self,
                              forbidden=None,
                              parent_xpath='numatune',
                              tag_name='memory')
     accessors.XMLElementText(property_name="cputune",
                              libvirtxml=self,
                              forbidden=None,
                              parent_xpath='/',
                              tag_name='cputune')
     accessors.XMLAttribute(property_name="emulatorpin",
                            libvirtxml=self,
                            forbidden=None,
                            parent_xpath='/cputune',
                            tag_name='emulatorpin',
                            attribute='cpuset')
     super(VMXMLBase, self).__init__(virsh_instance=virsh_instance)
Example #11
0
 def __init__(self, virsh_instance=base.base.virsh):
     accessors.XMLAttribute('vendor_id', self, parent_xpath='/',
                            tag_name='vendor', attribute='id')
     accessors.XMLAttribute('product_id', self, parent_xpath='/',
                            tag_name='product', attribute='id')
     accessors.XMLElementNest('untyped_address', self, parent_xpath='/',
                              tag_name='address', subclass=self.UntypedAddress,
                              subclass_dargs={
                                  'virsh_instance': virsh_instance})
     accessors.XMLAttribute('adapter_name', self, parent_xpath='/',
                            tag_name='adapter', attribute='name')
     accessors.XMLAttribute('protocol', self, parent_xpath='/',
                            tag_name='source', attribute='protocol')
     accessors.XMLAttribute('source_name', self, parent_xpath='/',
                            tag_name='source', attribute='name')
     accessors.XMLAttribute('host_name', self, parent_xpath='/',
                            tag_name='host', attribute='name')
     accessors.XMLAttribute('host_port', self, parent_xpath='/',
                            tag_name='host', attribute='port')
     accessors.XMLAttribute('address_bus', self, parent_xpath='/',
                            tag_name='address', attribute='bus')
     accessors.XMLAttribute('address_device', self, parent_xpath='/',
                            tag_name='address', attribute='device')
     accessors.XMLElementNest('auth', self, parent_xpath='/',
                              tag_name='auth', subclass=self.Auth,
                              subclass_dargs={
                                  'virsh_instance': virsh_instance})
     accessors.XMLElementNest('initiator', self, parent_xpath='/',
                              tag_name='initiator', subclass=self.Initiator,
                              subclass_dargs={
                                  'virsh_instance': virsh_instance})
     super(self.__class__, self).__init__(virsh_instance=virsh_instance)
     self.xml = '<source/>'
Example #12
0
 def __init__(self, virsh_instance=base.base.virsh):
     accessors.XMLElementDict('attrs',
                              self,
                              parent_xpath='/',
                              tag_name='source')
     accessors.XMLElementList('seclabels',
                              self,
                              parent_xpath='/',
                              marshal_from=self.marshal_from_seclabel,
                              marshal_to=self.marshal_to_seclabel)
     accessors.XMLElementList('hosts',
                              self,
                              parent_xpath='/',
                              marshal_from=self.marshal_from_host,
                              marshal_to=self.marshal_to_host)
     accessors.XMLElementNest(
         'encryption',
         self,
         parent_xpath='/',
         tag_name='encryption',
         subclass=Disk.Encryption,
         subclass_dargs={'virsh_instance': virsh_instance})
     accessors.XMLElementNest(
         'auth',
         self,
         parent_xpath='/',
         tag_name='auth',
         subclass=Disk.Auth,
         subclass_dargs={'virsh_instance': virsh_instance})
     accessors.XMLElementNest(
         'reservations',
         self,
         parent_xpath='/',
         tag_name='reservations',
         subclass=Disk.Reservations,
         subclass_dargs={'virsh_instance': virsh_instance})
     accessors.XMLElementNest(
         'slices',
         self,
         parent_xpath='/',
         tag_name='slices',
         subclass=Disk.Slices,
         subclass_dargs={'virsh_instance': virsh_instance})
     accessors.XMLAttribute('config_file',
                            self,
                            parent_xpath='/',
                            tag_name='config',
                            attribute='file')
     accessors.XMLAttribute('snapshot_name',
                            self,
                            parent_xpath='/',
                            tag_name='snapshot',
                            attribute='name')
     super(self.__class__, self).__init__(virsh_instance=virsh_instance)
     self.xml = '<source/>'
Example #13
0
 def __init__(self, virsh_instance=base.virsh):
     accessors.XMLElementText('interface', self, parent_xpath='/',
                              tag_name='interface')
     accessors.XMLElementText('address', self, parent_xpath='/',
                              tag_name='address')
     accessors.XMLAttribute('link_speed', self, parent_xpath='/',
                            tag_name='link', attribute='speed')
     accessors.XMLAttribute('link_state', self, parent_xpath='/',
                            tag_name='link', attribute='state')
     super(NetXML, self).__init__(virsh_instance=virsh_instance)
     self.xml = (' <capability type=\'net\'></capability>')
Example #14
0
 def __init__(self, virsh_instance=base.virsh):
     accessors.XMLAttribute('domain', self, parent_xpath='/',
                            tag_name='address', attribute='domain')
     accessors.XMLAttribute('bus', self, parent_xpath='/',
                            tag_name='address', attribute='bus')
     accessors.XMLAttribute('slot', self, parent_xpath='/',
                            tag_name='address', attribute='slot')
     accessors.XMLAttribute('function', self, parent_xpath='/',
                            tag_name='address', attribute='function')
     super(PCIXML.Address, self).__init__(virsh_instance=virsh_instance)
     self.xml = ('<address/>')
Example #15
0
 def __init__(self, virsh_instance=base.base.virsh, auth_user=""):
     accessors.XMLAttribute('auth_user', self, parent_xpath='/',
                            tag_name='auth', attribute='username')
     accessors.XMLAttribute('secret_type', self, parent_xpath='/',
                            tag_name='secret', attribute='type')
     accessors.XMLAttribute('secret_uuid', self, parent_xpath='/',
                            tag_name='secret', attribute='uuid')
     accessors.XMLAttribute('secret_usage', self, parent_xpath='/',
                            tag_name='secret', attribute='usage')
     super(self.__class__, self).__init__(virsh_instance=virsh_instance)
     self.xml = "<auth/>"
Example #16
0
    def __init__(self, protocol=None, virsh_instance=base.virsh):
        accessors.XMLAttribute('rule_action', self, parent_xpath='/',
                               tag_name='rule', attribute='action')
        accessors.XMLAttribute('rule_direction', self, parent_xpath='/',
                               tag_name='rule', attribute='direction')
        accessors.XMLAttribute('rule_priority', self, parent_xpath='/',
                               tag_name='rule', attribute='priority')
        accessors.XMLAttribute('rule_statematch', self, parent_xpath='/',
                               tag_name='rule', attribute='statematch')

        super(NwfilterXMLRules, self).__init__(virsh_instance=virsh_instance)
        self.xml = '<rule></rule>'
Example #17
0
 def __init__(self, virsh_instance=base.virsh):
     accessors.XMLElementText('name',
                              self,
                              parent_xpath='/',
                              tag_name='name')
     accessors.XMLElementText('uuid',
                              self,
                              parent_xpath='/',
                              tag_name='uuid')
     accessors.XMLAttribute('mac',
                            self,
                            parent_xpath='/',
                            tag_name='mac',
                            attribute='address')
     accessors.XMLElementDict('forward',
                              self,
                              parent_xpath='/',
                              tag_name='forward')
     accessors.XMLElementList('forward_interface',
                              self,
                              parent_xpath='/forward',
                              marshal_from=self.marshal_from_forward_iface,
                              marshal_to=self.marshal_to_forward_iface)
     accessors.XMLElementDict('nat_port',
                              self,
                              parent_xpath='/forward/nat',
                              tag_name='port')
     accessors.XMLElementDict('bridge',
                              self,
                              parent_xpath='/',
                              tag_name='bridge')
     accessors.XMLElementDict('bandwidth_inbound',
                              self,
                              parent_xpath='/bandwidth',
                              tag_name='inbound')
     accessors.XMLElementDict('bandwidth_outbound',
                              self,
                              parent_xpath='/bandwidth',
                              tag_name='outbound')
     accessors.XMLAttribute('domain_name',
                            self,
                            parent_xpath='/',
                            tag_name='domain',
                            attribute='name')
     accessors.XMLElementNest(
         'dns',
         self,
         parent_xpath='/',
         tag_name='dns',
         subclass=DNSXML,
         subclass_dargs={'virsh_instance': virsh_instance})
     super(NetworkXMLBase, self).__init__(virsh_instance=virsh_instance)
Example #18
0
 def __init__(self, type_name='pty', virsh_instance=base.virsh):
     # Additional attribute for protocol type (raw, telnet, telnets, tls)
     accessors.XMLAttribute('protocol_type', self, parent_xpath='/',
                            tag_name='protocol', attribute='type')
     accessors.XMLAttribute('target_port', self, parent_xpath='/',
                            tag_name='target', attribute='port')
     accessors.XMLAttribute('target_type', self, parent_xpath='/',
                            tag_name='target', attribute='type')
     accessors.XMLElementList('sources', self, parent_xpath='/',
                              marshal_from=self.marshal_from_sources,
                              marshal_to=self.marshal_to_sources)
     super(Serial, self).__init__(device_tag='serial', type_name=type_name,
                                  virsh_instance=virsh_instance)
Example #19
0
 def __init__(self, virsh_instance=base.base.virsh):
     accessors.XMLAttribute('address_type',
                            self,
                            parent_xpath='/',
                            tag_name='address',
                            attribute='type')
     accessors.XMLAttribute('address_reg',
                            self,
                            parent_xpath='/',
                            tag_name='address',
                            attribute='reg')
     super(Nvram, self).__init__(device_tag='nvram',
                                 virsh_instance=virsh_instance)
Example #20
0
 def __init__(self, address='192.168.122.1', netmask='255.255.255.0',
              virsh_instance=base.virsh):
     """
     Create new IPXML instance based on address/mask
     """
     accessors.XMLAttribute(
         'address', self, parent_xpath='/', tag_name='ip',
         attribute='address')
     accessors.XMLAttribute(
         'netmask', self, parent_xpath='/', tag_name='ip',
         attribute='netmask')
     super(IPXML, self).__init__(virsh_instance=virsh_instance)
     self.xml = u"<ip address='%s' netmask='%s'></ip>" % (address, netmask)
Example #21
0
 def __init__(self, type_name='dynamic', virsh_instance=base.base.virsh):
     accessors.XMLAttribute('model', self, parent_xpath='/',
                            tag_name='seclabel', attribute='model')
     accessors.XMLAttribute('relabel', self, parent_xpath='/',
                            tag_name='seclabel', attribute='relabel')
     accessors.XMLElementText('baselabel', self, parent_xpath='/',
                              tag_name='baselabel')
     accessors.XMLElementText('label', self, parent_xpath='/',
                              tag_name='label')
     super(Seclabel, self).__init__(device_tag='seclabel',
                                    type_name=type_name,
                                    virsh_instance=virsh_instance)
     self.xml = '<seclabel></seclabel>'
Example #22
0
 def __init__(self, type_name, virsh_instance=base.base.virsh):
     super(Interface, self).__init__(device_tag='interface',
                                     type_name=type_name,
                                     virsh_instance=virsh_instance)
     accessors.XMLElementDict(property_name="source",
                              libvirtxml=self,
                              forbidden=None,
                              parent_xpath='/',
                              tag_name='source')
     accessors.XMLElementDict(property_name="driver",
                              libvirtxml=self,
                              forbidden=None,
                              parent_xpath='/',
                              tag_name='driver')
     accessors.XMLAttribute(property_name="mac_address",
                            libvirtxml=self,
                            forbidden=None,
                            parent_xpath='/',
                            tag_name='mac',
                            attribute='address')
     accessors.XMLElementDict(property_name="bandwidth_inbound",
                              libvirtxml=self,
                              forbidden=None,
                              parent_xpath='/bandwidth',
                              tag_name='inbound')
     accessors.XMLElementDict(property_name="bandwidth_outbound",
                              libvirtxml=self,
                              forbidden=None,
                              parent_xpath='/bandwidth',
                              tag_name='outbound')
     accessors.XMLAttribute(property_name="portgroup",
                            libvirtxml=self,
                            forbidden=None,
                            parent_xpath='/',
                            tag_name='source',
                            attribute='portgroup')
     accessors.XMLAttribute(property_name="model",
                            libvirtxml=self,
                            forbidden=None,
                            parent_xpath='/',
                            tag_name='model',
                            attribute='type')
     accessors.XMLElementNest('address',
                              self,
                              parent_xpath='/',
                              tag_name='address',
                              subclass=self.Address,
                              subclass_dargs={
                                  'type_name': 'drive',
                                  'virsh_instance': virsh_instance
                              })
Example #23
0
 def __init__(self, virsh_instance=base.base.virsh):
     accessors.XMLAttribute('mem_model',
                            self,
                            parent_xpath='/',
                            tag_name='memory',
                            attribute='model')
     accessors.XMLAttribute('mem_discard',
                            self,
                            parent_xpath='/',
                            tag_name='memory',
                            attribute='discard')
     accessors.XMLAttribute('mem_access',
                            self,
                            parent_xpath='/',
                            tag_name='memory',
                            attribute='access')
     accessors.XMLElementText("uuid",
                              self,
                              parent_xpath='/',
                              tag_name='uuid')
     accessors.XMLElementNest(
         'target',
         self,
         parent_xpath='/',
         tag_name='target',
         subclass=self.Target,
         subclass_dargs={'virsh_instance': virsh_instance})
     accessors.XMLElementNest(
         'source',
         self,
         parent_xpath='/',
         tag_name='source',
         subclass=self.Source,
         subclass_dargs={'virsh_instance': virsh_instance})
     accessors.XMLElementNest('address',
                              self,
                              parent_xpath='/',
                              tag_name='address',
                              subclass=self.Address,
                              subclass_dargs={
                                  'type_name': 'dimm',
                                  'virsh_instance': virsh_instance
                              })
     accessors.XMLElementDict('alias',
                              self,
                              parent_xpath='/',
                              tag_name='alias')
     super(Memory, self).__init__(device_tag='memory',
                                  virsh_instance=virsh_instance)
     self.xml = '<memory/>'
Example #24
0
 def __init__(self, virsh_instance=base.virsh):
     """
     Create new SourceXML instance.
     """
     accessors.XMLAttribute(property_name='device_path',
                            libvirtxml=self,
                            parent_xpath='/',
                            tag_name='device',
                            attribute='path')
     accessors.XMLElementText(property_name='vg_name',
                              libvirtxml=self,
                              parent_xpath='/',
                              tag_name='name')
     accessors.XMLAttribute(property_name='host_name',
                            libvirtxml=self,
                            parent_xpath='/',
                            tag_name='host',
                            attribute='name')
     accessors.XMLAttribute(property_name='dir_path',
                            libvirtxml=self,
                            parent_xpath='/',
                            tag_name='dir',
                            attribute='path')
     accessors.XMLAttribute(property_name='adp_type',
                            libvirtxml=self,
                            parent_xpath='/',
                            tag_name='adapter',
                            attribute='type')
     accessors.XMLAttribute(property_name='adp_name',
                            libvirtxml=self,
                            parent_xpath='/',
                            tag_name='adapter',
                            attribute='name')
     accessors.XMLAttribute(property_name='adp_parent',
                            libvirtxml=self,
                            parent_xpath='/',
                            tag_name='adapter',
                            attribute='parent')
     accessors.XMLAttribute(property_name='adp_wwnn',
                            libvirtxml=self,
                            parent_xpath='/',
                            tag_name='adapter',
                            attribute='wwnn')
     accessors.XMLAttribute(property_name='adp_wwpn',
                            libvirtxml=self,
                            parent_xpath='/',
                            tag_name='adapter',
                            attribute='wwpn')
     accessors.XMLAttribute(property_name='format_type',
                            libvirtxml=self,
                            parent_xpath='/',
                            tag_name='format',
                            attribute='type')
     super(SourceXML, self).__init__(virsh_instance=virsh_instance)
     self.xml = u"<source></source>"
Example #25
0
    def __init__(self, virsh_instance=base.virsh):
        accessors.XMLAttribute('filter_name', self, parent_xpath='/',
                               tag_name='filter', attribute='name')
        accessors.XMLAttribute('filter_chain', self, parent_xpath='/',
                               tag_name='filter', attribute='chain')
        accessors.XMLAttribute('filter_priority', self, parent_xpath='/',
                               tag_name='filter', attribute='priority')
        accessors.XMLElementText('uuid', self, parent_xpath='/',
                                 tag_name='uuid')
        accessors.XMLElementText('filterref', self, parent_xpath='/',
                                 tag_name='filterref')
        accessors.XMLAttribute('filterref_name', self, parent_xpath='/',
                               tag_name='filterref', attribute='filter')

        super(NwfilterXMLBase, self).__init__(virsh_instance=virsh_instance)
Example #26
0
 def __init__(self, virsh_instance=base.virsh):
     accessors.XMLElementInt('domain', self, parent_xpath='/',
                             tag_name='domain')
     accessors.XMLElementInt('bus', self, parent_xpath='/',
                             tag_name='bus')
     accessors.XMLElementInt('slot', self, parent_xpath='/',
                             tag_name='slot')
     accessors.XMLElementInt('function', self, parent_xpath='/',
                             tag_name='function')
     accessors.XMLAttribute('product_id', self, parent_xpath='/',
                            tag_name='product', attribute='id')
     accessors.XMLAttribute('vendor_id', self, parent_xpath='/',
                            tag_name='vendor', attribute='id')
     super(PCIXML, self).__init__(virsh_instance=virsh_instance)
     self.xml = (' <capability type=\'pci\'></capability>')
Example #27
0
 def __init__(self, type_name, virsh_instance=base.base.virsh):
     super(Input, self).__init__(device_tag='input',
                                 type_name=type_name,
                                 virsh_instance=virsh_instance)
     accessors.XMLAttribute(property_name="input_bus",
                            libvirtxml=self,
                            forbidden=None,
                            parent_xpath='/',
                            tag_name='input',
                            attribute='bus')
     accessors.XMLElementNest('address', self, parent_xpath='/',
                              tag_name='address', subclass=self.Address,
                              subclass_dargs={'type_name': 'usb',
                                              'virsh_instance': virsh_instance})
     accessors.XMLAttribute('source_evdev', self, parent_xpath='/',
                            tag_name='source', attribute='evdev')
Example #28
0
 def __init__(self, virsh_instance=base.virsh):
     accessors.XMLAttribute(property_name='pool_type',
                            libvirtxml=self,
                            parent_xpath='/',
                            tag_name='pool',
                            attribute='type')
     accessors.XMLElementText(property_name='name',
                              libvirtxml=self,
                              parent_xpath='/',
                              tag_name='name')
     accessors.XMLElementText(property_name='uuid',
                              libvirtxml=self,
                              parent_xpath='/',
                              tag_name='uuid')
     accessors.XMLElementInt(property_name='capacity',
                             libvirtxml=self,
                             parent_xpath='/',
                             tag_name='capacity')
     accessors.XMLElementInt(property_name='allocation',
                             libvirtxml=self,
                             parent_xpath='/',
                             tag_name='allocation')
     accessors.XMLElementInt(property_name='available',
                             libvirtxml=self,
                             parent_xpath='/',
                             tag_name='available')
     accessors.XMLElementText(property_name='target_path',
                              libvirtxml=self,
                              parent_xpath='/target',
                              tag_name='path')
     super(PoolXMLBase, self).__init__(virsh_instance=virsh_instance)
Example #29
0
 def __init__(self, virsh_instance=base.virsh):
     """
     Create new IPXML instance based on address/mask
     """
     accessors.XMLElementDict('txt', self, parent_xpath='/', tag_name='txt')
     accessors.XMLElementDict('srv', self, parent_xpath='/', tag_name='srv')
     accessors.XMLElementList('forwarders',
                              self,
                              parent_xpath='/',
                              marshal_from=self.marshal_from_forwarder,
                              marshal_to=self.marshal_to_forwarder)
     accessors.XMLAttribute('dns_forward',
                            self,
                            parent_xpath='/',
                            tag_name='dns',
                            attribute='forwardPlainNames')
     accessors.XMLElementNest(
         'host',
         self,
         parent_xpath='/',
         tag_name='host',
         subclass=DNSXML.HostXML,
         subclass_dargs={'virsh_instance': virsh_instance})
     super(DNSXML, self).__init__(virsh_instance=virsh_instance)
     self.xml = u"<dns></dns>"
Example #30
0
 def __init__(self, virsh_instance=virsh):
     accessors.XMLAttribute(property_name="hypervisor_type",
                            libvirtxml=self,
                            forbidden=None,
                            parent_xpath='/',
                            tag_name='domain',
                            attribute='type')
     accessors.XMLElementText(property_name="vm_name",
                              libvirtxml=self,
                              forbidden=None,
                              parent_xpath='/',
                              tag_name='name')
     accessors.XMLElementText(property_name="uuid",
                              libvirtxml=self,
                              forbidden=None,
                              parent_xpath='/',
                              tag_name='uuid')
     accessors.XMLElementInt(property_name="vcpu",
                             libvirtxml=self,
                             forbidden=None,
                             parent_xpath='/',
                             tag_name='vcpu')
     accessors.XMLElementInt(property_name="max_mem",
                             libvirtxml=self,
                             forbidden=None,
                             parent_xpath='/',
                             tag_name='memory')
     accessors.XMLElementInt(property_name="current_mem",
                             libvirtxml=self,
                             forbidden=None,
                             parent_xpath='/',
                             tag_name='currentMemory')
     super(VMXMLBase, self).__init__(virsh_instance)