예제 #1
0
파일: disk.py 프로젝트: mxie91/avocado-vt
        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})
            accessors.XMLElementNest('backingstore', self, parent_xpath='/',
                                     tag_name='backingStore',
                                     subclass=Disk.BackingStore,
                                     subclass_dargs={
                                         'virsh_instance': virsh_instance})

            super(self.__class__, self).__init__(virsh_instance=virsh_instance)
            self.xml = '<backingStore/>'
예제 #2
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.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/>'
예제 #3
0
파일: disk.py 프로젝트: mxie91/avocado-vt
 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/>'
예제 #4
0
    def __init__(self, virsh_instance=base.virsh):
        accessors.XMLElementNest(
            "owner",
            self,
            parent_xpath='/',
            tag_name='owner',
            subclass=self.Owner,
            subclass_dargs={'virsh_instance': virsh_instance})
        accessors.XMLAttribute('portdev',
                               self,
                               parent_xpath='/',
                               tag_name='portdev',
                               attribute='name')
        accessors.XMLAttribute('mac_address',
                               self,
                               parent_xpath='/',
                               tag_name='mac',
                               attribute='address')
        accessors.XMLElementNest(
            "filterref",
            self,
            parent_xpath='/',
            tag_name='filterref',
            subclass=Filterref,
            subclass_dargs={'virsh_instance': virsh_instance})
        super(NwfilterBinding, self).__init__(virsh_instance=virsh_instance)

        self.xml = u'<filterbinding></filterbinding>'
예제 #5
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/>'
예제 #6
0
        def __init__(self, virsh_instance=base.virsh):
            accessors.XMLAttribute('name',
                                   self,
                                   parent_xpath='/',
                                   tag_name='disk',
                                   attribute='name')
            accessors.XMLAttribute('backup',
                                   self,
                                   parent_xpath='/',
                                   tag_name='disk',
                                   attribute='backup')
            accessors.XMLAttribute('exportname',
                                   self,
                                   parent_xpath='/',
                                   tag_name='disk',
                                   attribute='exportname')
            accessors.XMLAttribute('exportbitmap',
                                   self,
                                   parent_xpath='/',
                                   tag_name='disk',
                                   attribute='exportbitmap')
            accessors.XMLAttribute('type',
                                   self,
                                   parent_xpath='/',
                                   tag_name='disk',
                                   attribute='type')
            accessors.XMLAttribute('backupmode',
                                   self,
                                   parent_xpath='/',
                                   tag_name='disk',
                                   attribute='backupmode')
            accessors.XMLAttribute('incremental',
                                   self,
                                   parent_xpath='/',
                                   tag_name='disk',
                                   attribute='incremental')
            accessors.XMLElementNest(
                'target',
                self,
                parent_xpath='/',
                tag_name='target',
                subclass=self.DiskTarget,
                subclass_dargs={'virsh_instance': virsh_instance})
            accessors.XMLElementDict('driver',
                                     self,
                                     parent_xpath='/',
                                     tag_name='driver')
            accessors.XMLElementNest(
                'scratch',
                self,
                parent_xpath='/',
                tag_name='scratch',
                subclass=self.DiskScratch,
                subclass_dargs={'virsh_instance': virsh_instance})

            super(self.__class__, self).__init__(virsh_instance=virsh_instance)
            self.xml = "<disk/>"
예제 #7
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')
     super(self.__class__, self).__init__(virsh_instance=virsh_instance)
     self.xml = '<source/>'
예제 #8
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})
     accessors.XMLElementList('routes', self, parent_xpath='/',
                              marshal_from=self.marshal_from_route,
                              marshal_to=self.marshal_to_route)
     accessors.XMLAttribute('virtualport_type', self, parent_xpath='/',
                            tag_name='virtualport', attribute='type')
     super(NetworkXMLBase, self).__init__(virsh_instance=virsh_instance)
예제 #9
0
파일: disk.py 프로젝트: mxie91/avocado-vt
            def __init__(self, virsh_instance=base.base.virsh):
                accessors.XMLElementDict('attrs', self,
                                         parent_xpath='/',
                                         tag_name='source')
                accessors.XMLAttribute('dev', self,
                                       parent_xpath='/',
                                       tag_name='source',
                                       attribute='dev')
                accessors.XMLAttribute('protocol', self,
                                       parent_xpath='/',
                                       tag_name='source',
                                       attribute='protocol')
                accessors.XMLAttribute('name', self,
                                       parent_xpath='/',
                                       tag_name='source',
                                       attribute='name')
                accessors.XMLElementDict('host', self,
                                         parent_xpath='/',
                                         tag_name='host')
                accessors.XMLAttribute('file', self,
                                       parent_xpath='/',
                                       tag_name='source',
                                       attribute='file')
                accessors.XMLElementNest('auth', self,
                                         parent_xpath='/',
                                         tag_name='auth',
                                         subclass=Disk.Auth,
                                         subclass_dargs={
                                            'virsh_instance': virsh_instance})

                super(self.__class__, self).__init__(virsh_instance=virsh_instance)
                self.xml = '<source/>'
예제 #10
0
 def __init__(self, type_name='mount', virsh_instance=base.base.virsh):
     accessors.XMLAttribute('accessmode',
                            self,
                            parent_xpath='/',
                            tag_name='filesystem',
                            attribute='accessmode')
     accessors.XMLElementDict('source',
                              self,
                              parent_xpath='/',
                              tag_name='source')
     accessors.XMLElementDict('target',
                              self,
                              parent_xpath='/',
                              tag_name='target')
     accessors.XMLElementDict('driver',
                              self,
                              parent_xpath='/',
                              tag_name='driver')
     accessors.XMLElementNest(
         'binary',
         self,
         parent_xpath='/',
         tag_name='binary',
         subclass=self.Binary,
         subclass_dargs={'virsh_instance': virsh_instance})
     accessors.XMLElementDict('alias',
                              self,
                              parent_xpath='/',
                              tag_name='alias')
     super(Filesystem, self).__init__(device_tag='filesystem',
                                      type_name=type_name,
                                      virsh_instance=virsh_instance)
예제 #11
0
 def __init__(self, virsh_instance=base.virsh):
     """
     Create new IPXML instance based on address/mask
     """
     accessors.XMLAttribute('enable',
                            self,
                            parent_xpath='/',
                            tag_name='dns',
                            attribute='enable')
     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>"
예제 #12
0
 def __init__(self, type_name='file', virsh_instance=base.base.virsh):
     accessors.XMLElementNest('attrs', self, parent_xpath='/',
                              tag_name='arp', subclass=self.Attr,
                              subclass_dargs={
                                  'virsh_instance': virsh_instance})
     super(Arp, self).__init__(protocol_tag='arp', type_name=type_name,
                               virsh_instance=virsh_instance)
예제 #13
0
파일: hostdev.py 프로젝트: penght/virt-test
 def __init__(self, type_name="hostdev", virsh_instance=base.base.virsh):
     accessors.XMLAttribute('hostdev_type',
                            self,
                            parent_xpath='/',
                            tag_name='hostdev',
                            attribute='type')
     accessors.XMLAttribute('mode',
                            self,
                            parent_xpath='/',
                            tag_name='hostdev',
                            attribute='mode')
     accessors.XMLAttribute('managed',
                            self,
                            parent_xpath='/',
                            tag_name='hostdev',
                            attribute='managed')
     accessors.XMLElementNest(
         'source_address',
         self,
         parent_xpath='/',
         tag_name='source',
         subclass=self.SourceAddress,
         subclass_dargs={'virsh_instance': virsh_instance})
     super(self.__class__, self).__init__(device_tag='hostdev',
                                          type_name=type_name,
                                          virsh_instance=virsh_instance)
예제 #14
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')
예제 #15
0
 def __init__(self, type_name="hostdev", virsh_instance=base.base.virsh):
     accessors.XMLAttribute('type', self, parent_xpath='/',
                            tag_name='hostdev', attribute='type')
     accessors.XMLAttribute('mode', self, parent_xpath='/',
                            tag_name='hostdev', attribute='mode')
     accessors.XMLAttribute('model', self, parent_xpath='/',
                            tag_name='hostdev', attribute='model')
     accessors.XMLAttribute('managed', self, parent_xpath='/',
                            tag_name='hostdev', attribute='managed')
     accessors.XMLAttribute('sgio', self, parent_xpath='/',
                            tag_name='hostdev', attribute='sgio')
     accessors.XMLAttribute('rawio', self, parent_xpath='/',
                            tag_name='hostdev', attribute='rawio')
     accessors.XMLElementNest('source', self, parent_xpath='/',
                              tag_name='source', subclass=self.Source,
                              subclass_dargs={
                                  'virsh_instance': virsh_instance})
     accessors.XMLAttribute('boot_order', self, parent_xpath='/',
                            tag_name='boot', attribute='order')
     accessors.XMLElementBool('readonly', self, parent_xpath='/',
                              tag_name='readonly')
     accessors.XMLElementBool('shareable', self, parent_xpath='/',
                              tag_name='shareable')
     accessors.XMLElementDict('alias', self, parent_xpath='/',
                              tag_name='alias')
     super(self.__class__, self).__init__(device_tag='hostdev',
                                          type_name=type_name,
                                          virsh_instance=virsh_instance)
예제 #16
0
 def __init__(self, virsh_instance=base.virsh):
     accessors.XMLElementText('name',
                              self,
                              parent_xpath='/',
                              tag_name='name')
     accessors.XMLElementText('key', self, parent_xpath='/', tag_name='key')
     accessors.XMLElementInt('capacity',
                             self,
                             parent_xpath='/',
                             tag_name='capacity')
     accessors.XMLElementInt('allocation',
                             self,
                             parent_xpath='/',
                             tag_name='allocation')
     accessors.XMLAttribute('format',
                            self,
                            parent_xpath='/target',
                            tag_name='format',
                            attribute='type')
     accessors.XMLAttribute('capacity_unit',
                            self,
                            parent_xpath='/',
                            tag_name='capacity',
                            attribute='unit')
     accessors.XMLElementNest(
         'encryption',
         self,
         parent_xpath='/target',
         tag_name='encryption',
         subclass=self.Encryption,
         subclass_dargs={'virsh_instance': virsh_instance})
     accessors.XMLElementText('path',
                              self,
                              parent_xpath='/target',
                              tag_name='path')
     accessors.XMLElementInt('owner',
                             self,
                             parent_xpath='/target/permissions',
                             tag_name='owner')
     accessors.XMLElementInt('group',
                             self,
                             parent_xpath='/target/permissions',
                             tag_name='group')
     accessors.XMLElementText('mode',
                              self,
                              parent_xpath='/target/permissions',
                              tag_name='mode')
     accessors.XMLElementText('label',
                              self,
                              parent_xpath='/target/permissions',
                              tag_name='label')
     accessors.XMLElementText('compat',
                              self,
                              parent_xpath='/target',
                              tag_name='compat')
     accessors.XMLElementBool('lazy_refcounts',
                              self,
                              parent_xpath='/target/features',
                              tag_name='lazy_refcounts')
     super(VolXMLBase, self).__init__(virsh_instance=virsh_instance)
예제 #17
0
파일: tpm.py 프로젝트: dzhengfy/avocado-vt
 def __init__(self, virsh_instance=base.base.virsh):
     accessors.XMLAttribute(property_name="backend_type",
                            libvirtxml=self,
                            parent_xpath='/',
                            tag_name='backend',
                            attribute='type')
     accessors.XMLAttribute(property_name="backend_version",
                            libvirtxml=self,
                            parent_xpath='/',
                            tag_name='backend',
                            attribute='version')
     accessors.XMLAttribute(property_name="persistent_state",
                            libvirtxml=self,
                            parent_xpath='/',
                            tag_name='backend',
                            attribute='persistent_state')
     accessors.XMLAttribute(property_name="device_path",
                            libvirtxml=self,
                            parent_xpath='/',
                            tag_name='device',
                            attribute='path')
     accessors.XMLAttribute(property_name="encryption_secret",
                            libvirtxml=self,
                            parent_xpath='/',
                            tag_name='encryption',
                            attribute='secret')
     accessors.XMLElementNest('active_pcr_banks',
                              libvirtxml=self,
                              parent_xpath='/',
                              tag_name='active_pcr_banks',
                              subclass=self.ActivePCRBanks,
                              subclass_dargs={
                                  'virsh_instance': virsh_instance})
     super(self.__class__, self).__init__(virsh_instance=virsh_instance)
     self.xml = '<backend/>'
예제 #18
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.XMLAttribute(property_name="model",
                            libvirtxml=self,
                            parent_xpath='/',
                            tag_name='input',
                            attribute='model')
     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')
예제 #19
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/>'
예제 #20
0
 def __init__(self,
              address='192.168.122.1',
              netmask='255.255.255.0',
              ipv6=False,
              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')
     accessors.XMLAttribute('family',
                            self,
                            parent_xpath='/',
                            tag_name='ip',
                            attribute='family')
     accessors.XMLAttribute('prefix',
                            self,
                            parent_xpath='/',
                            tag_name='ip',
                            attribute='prefix')
     accessors.XMLAttribute('tftp_root',
                            self,
                            parent_xpath='/',
                            tag_name='tftp',
                            attribute='root')
     accessors.XMLAttribute('dhcp_bootp',
                            self,
                            parent_xpath='/dhcp',
                            tag_name='bootp',
                            attribute='file')
     accessors.XMLElementNest(
         'dhcp_ranges',
         self,
         parent_xpath='/dhcp',
         tag_name='range',
         subclass=RangeXML,
         subclass_dargs={'virsh_instance': virsh_instance})
     accessors.XMLElementList('hosts',
                              self,
                              parent_xpath='/dhcp',
                              marshal_from=self.marshal_from_hosts,
                              marshal_to=self.marshal_to_hosts,
                              has_subclass=True)
     super(IPXML, self).__init__(virsh_instance=virsh_instance)
     if ipv6:
         self.xml = u"<ip address='%s'></ip>" % address
     else:
         self.xml = u"<ip address='%s' netmask='%s'></ip>" % (address,
                                                              netmask)
예제 #21
0
파일: disk.py 프로젝트: mxie91/avocado-vt
 def __init__(self, virsh_instance=base.base.virsh):
     accessors.XMLElementDict('attrs', self, parent_xpath='/',
                              tag_name='driver')
     accessors.XMLElementNest('metadata_cache', self, parent_xpath='/',
                              tag_name='metadata_cache',
                              subclass=self.MetadataCache,
                              subclass_dargs={
                                  'virsh_instance': virsh_instance})
     super(self.__class__, self).__init__(virsh_instance=virsh_instance)
     self.xml = '<driver/>'
예제 #22
0
파일: hostdev.py 프로젝트: penght/virt-test
 def __init__(self, virsh_instance=base.base.virsh):
     accessors.XMLElementNest(
         'untyped_address',
         self,
         parent_xpath='/',
         tag_name='address',
         subclass=self.UntypedAddress,
         subclass_dargs={'virsh_instance': virsh_instance})
     super(self.__class__, self).__init__(virsh_instance=virsh_instance)
     self.xml = '<source/>'
예제 #23
0
 def __init__(self, type_name="redirdev", virsh_instance=base.base.virsh):
     super(Redirdev, self).__init__(device_tag='redirdev',
                                    type_name=type_name,
                                    virsh_instance=virsh_instance)
     accessors.XMLAttribute('type',
                            self,
                            parent_xpath='/',
                            tag_name='redirdev',
                            attribute='type')
     accessors.XMLAttribute('bus',
                            self,
                            parent_xpath='/',
                            tag_name='redirdev',
                            attribute='bus')
     accessors.XMLElementNest(
         'source',
         self,
         parent_xpath='/',
         tag_name='source',
         subclass=self.Source,
         subclass_dargs={'virsh_instance': virsh_instance})
     accessors.XMLElementDict('protocol',
                              self,
                              parent_xpath='/',
                              tag_name='protocol')
     accessors.XMLElementDict('boot',
                              self,
                              parent_xpath='/',
                              tag_name='boot')
     accessors.XMLElementDict('alias',
                              self,
                              parent_xpath='/',
                              tag_name='alias')
     accessors.XMLElementNest('address',
                              self,
                              parent_xpath='/',
                              tag_name='address',
                              subclass=self.Address,
                              subclass_dargs={
                                  'type_name': 'usb',
                                  'virsh_instance': virsh_instance
                              })
예제 #24
0
파일: tpm.py 프로젝트: dzhengfy/avocado-vt
 def __init__(self, virsh_instance=base.base.virsh):
     accessors.XMLAttribute('tpm_model', self,
                            parent_xpath='/',
                            tag_name='tpm',
                            attribute='model')
     accessors.XMLElementNest('backend', self, parent_xpath='/',
                              tag_name='backend', subclass=self.Backend,
                              subclass_dargs={
                                  'virsh_instance': virsh_instance})
     super(Tpm, self).__init__(
         device_tag='tpm', virsh_instance=virsh_instance)
예제 #25
0
    def __init__(self, virsh_instance=base.virsh):
        accessors.XMLElementNest(property_name='features',
                                 libvirtxml=self,
                                 parent_xpath='/',
                                 tag_name='features',
                                 subclass=DomCapFeaturesXML,
                                 subclass_dargs={
                                     'virsh_instance': virsh_instance})

        super(DomCapabilityXML, self).__init__(virsh_instance)
        self['xml'] = self.__dict_get__('virsh').domcapabilities().stdout.strip()
예제 #26
0
파일: rng.py 프로젝트: zixi-chen/avocado-vt
 def __init__(self, virsh_instance=base.base.virsh):
     accessors.XMLAttribute('rng_model', self,
                            parent_xpath='/',
                            tag_name='rng',
                            attribute='model')
     accessors.XMLElementDict('rate', self,
                              parent_xpath='/',
                              tag_name='rate')
     accessors.XMLElementNest('backend', self, parent_xpath='/',
                              tag_name='backend', subclass=self.Backend,
                              subclass_dargs={
                                  'virsh_instance': virsh_instance})
     accessors.XMLElementNest('address', self, parent_xpath='/',
                              tag_name='address', subclass=self.Address,
                              subclass_dargs={'type_name': 'pci',
                                              'virsh_instance': virsh_instance})
     accessors.XMLElementDict('alias', self, parent_xpath='/',
                              tag_name='alias')
     super(Rng, self).__init__(
         device_tag='rng', virsh_instance=virsh_instance)
     self.xml = '<rng/>'
예제 #27
0
파일: disk.py 프로젝트: spiceqa/virt-test
 def __init__(self, type_name='file', virsh_instance=base.base.virsh):
     accessors.XMLAttribute('device', self, parent_xpath='/',
                            tag_name='disk', attribute='device')
     accessors.XMLAttribute('rawio', self, parent_xpath='/',
                            tag_name='disk', attribute='rawio')
     accessors.XMLAttribute('sgio', self, parent_xpath='/',
                            tag_name='disk', attribute='sgio')
     accessors.XMLAttribute('snapshot', self, parent_xpath='/',
                            tag_name='disk', attribute='snapshot')
     accessors.XMLElementDict('driver', self, parent_xpath='/',
                              tag_name='driver')
     accessors.XMLElementDict('target', self, parent_xpath='/',
                              tag_name='target')
     accessors.XMLElementNest('address', self, parent_xpath='/',
                              tag_name='address', subclass=self.Address,
                              subclass_dargs={'type_name': 'drive',
                                              'virsh_instance': virsh_instance})
     accessors.XMLAttribute('boot', self, parent_xpath='/',
                            tag_name='boot', attribute='order')
     accessors.XMLElementBool('readonly', self, parent_xpath='/',
                              tag_name='readonly')
     accessors.XMLElementBool('transient', self, parent_xpath='/',
                              tag_name='transient')
     accessors.XMLElementBool('share', self, parent_xpath='/',
                              tag_name='shareable')
     accessors.XMLElementNest('source', self, parent_xpath='/',
                              tag_name='source', subclass=self.DiskSource,
                              subclass_dargs={
                                  'virsh_instance': virsh_instance})
     ro = ['set', 'del']
     accessors.XMLElementBool('mirror', self, forbidden=ro,
                              parent_xpath='/', tag_name='mirror')
     accessors.XMLElementBool('ready', self, forbidden=ro,
                              parent_xpath='/', tag_name='ready')
     accessors.XMLElementNest('iotune', self, parent_xpath='/',
                              tag_name='iotune', subclass=self.IOTune,
                              subclass_dargs={
                                  'virsh_instance': virsh_instance})
     super(Disk, self).__init__(device_tag='disk', type_name=type_name,
                                virsh_instance=virsh_instance)
예제 #28
0
 def __init__(self, virsh_instance=base.virsh):
     accessors.XMLElementText(property_name="uuid",
                              libvirtxml=self,
                              forbidden=['set', 'del'],
                              parent_xpath='/host',
                              tag_name='uuid')
     # This will skip self.get_guest_capabilities() defined below
     accessors.AllForbidden(property_name="guest_capabilities",
                            libvirtxml=self)
     # This will skip self.get_cpu_count() defined below
     accessors.AllForbidden(property_name="cpu_count", libvirtxml=self)
     # The set action is for test.
     accessors.XMLElementText(property_name="arch",
                              libvirtxml=self,
                              forbidden=['del'],
                              parent_xpath='/host/cpu',
                              tag_name='arch')
     accessors.XMLElementText(property_name="model",
                              libvirtxml=self,
                              forbidden=['del'],
                              parent_xpath='/host/cpu',
                              tag_name='model')
     accessors.XMLElementText(property_name="vendor",
                              libvirtxml=self,
                              forbidden=['del'],
                              parent_xpath='/host/cpu',
                              tag_name='vendor')
     accessors.XMLElementDict(property_name="cpu_topology",
                              libvirtxml=self,
                              forbidden=['del'],
                              parent_xpath='/host/cpu',
                              tag_name='topology')
     accessors.XMLElementDict(property_name="iommu",
                              libvirtxml=self,
                              forbidden=['del'],
                              parent_xpath='/host',
                              tag_name='iommu')
     accessors.XMLElementNest(
         property_name='cells_topology',
         libvirtxml=self,
         parent_xpath='/host',
         tag_name='topology',
         subclass=TopologyXML,
         subclass_dargs={'virsh_instance': virsh_instance})
     # This will skip self.get_feature_list() defined below
     accessors.AllForbidden(property_name="feature_list", libvirtxml=self)
     # This will skip self.get_power_management_list() defined below
     accessors.AllForbidden(property_name="power_management_list",
                            libvirtxml=self)
     super(CapabilityXML, self).__init__(virsh_instance)
     # calls set_xml accessor method
     self['xml'] = self.__dict_get__('virsh').capabilities()
예제 #29
0
 def __init__(self, type_name, virsh_instance=base.base.virsh):
     super(Hub, self).__init__(device_tag='hub',
                               type_name=type_name,
                               virsh_instance=virsh_instance)
     accessors.XMLElementNest('address',
                              self,
                              parent_xpath='/',
                              tag_name='address',
                              subclass=self.Address,
                              subclass_dargs={
                                  'type_name': 'usb',
                                  'virsh_instance': virsh_instance
                              })
예제 #30
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
                              })