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.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/>'
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/>'
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>')
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)
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') 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.XMLElementDict('dhcp_ranges', self, parent_xpath='/dhcp', tag_name='range') accessors.XMLElementList('hosts', self, parent_xpath='/dhcp', marshal_from=self.marshal_from_host, marshal_to=self.marshal_to_host) super(IPXML, self).__init__(virsh_instance=virsh_instance) self.xml = u"<ip address='%s' netmask='%s'></ip>" % (address, netmask)
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>"
def __init__(self, virsh_instance=base.virsh, offset="utc"): """ Create new VMClock XML instance """ # The set action is for test. accessors.XMLAttribute(property_name="offset", libvirtxml=self, forbidden=[], parent_xpath='/', tag_name='clock', attribute='offset') accessors.XMLAttribute(property_name="timezone", libvirtxml=self, forbidden=[], parent_xpath='/', tag_name='clock', attribute='timezone') accessors.XMLAttribute(property_name="adjustment", libvirtxml=self, forbidden=[], parent_xpath='/', tag_name='clock', attribute='adjustment') accessors.XMLElementList(property_name="timers", libvirtxml=self, forbidden=[], parent_xpath="/clock", marshal_from=self.marshal_from_timer, marshal_to=self.marshal_to_timer) super(VMClockXML, self).__init__(virsh_instance=virsh_instance) # Set default offset for clock self.offset = offset
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/>'
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.XMLElementList(property_name='filterrefs', libvirtxml=self, parent_xpath='/', marshal_from=self.marshal_from_filterref, marshal_to=self.marshal_to_filterref) super(NwfilterXMLBase, self).__init__(virsh_instance=virsh_instance)
def __init__(self, virsh_instance): accessors.XMLElementList('bar', self, parent_xpath='/bar', marshal_from=self.from_it, marshal_to=self.to_it) # pylint: disable=E1003 super(Foo, self).__init__(virsh_instance=virsh_instance) self.xml = """<foo><bar>
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.XMLAttribute('target_model', self, parent_xpath='/target', tag_name='model', attribute='name') 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)
def __init__(self, virsh_instance): accessors.XMLElementList('bar', self, parent_xpath='/bar', marshal_from=Whatchamacallit.from_it, marshal_to=Whatchamacallit.to_it) super(Foo, self).__init__(virsh_instance=virsh_instance) self.xml = """<foo><bar>
def __init__(self, virsh_instance=base.base.virsh): accessors.XMLElementList(property_name='usbdevs', libvirtxml=self, parent_xpath='/', marshal_from=self.marshal_from_usbdev, marshal_to=self.marshal_to_usbdev) super(Redirfilter, self).__init__(virsh_instance=virsh_instance) self.xml = '<redirfilter/>'
def __init__(self, virsh_instance=base.virsh): """ Create new TimerXML instance """ accessors.XMLAttribute('host_ip', self, parent_xpath='/', tag_name='host', attribute='ip') accessors.XMLElementList('hostnames', self, parent_xpath='/', marshal_from=self.marshal_from_hostname, marshal_to=self.marshal_to_hostname) super(DNSXML.HostXML, self).__init__(virsh_instance=virsh_instance) self.xml = '<host/>'
def __init__(self, virsh_instance=base.virsh): """ Create new cpus XML instance """ accessors.XMLAttribute(property_name="cell_id", libvirtxml=self, parent_xpath='/', tag_name='cell', attribute='id') accessors.XMLElementInt(property_name="memory", libvirtxml=self, parent_xpath='/', tag_name='memory') accessors.XMLAttribute(property_name="mem_unit", libvirtxml=self, parent_xpath='/', tag_name='memory', attribute='unit') accessors.XMLElementList(property_name="pages", libvirtxml=self, parent_xpath='/', marshal_from=self.marshal_from_pages, marshal_to=self.marshal_to_pages) accessors.XMLElementList(property_name="sibling", libvirtxml=self, parent_xpath='/distances', marshal_from=self.marshal_from_sibling, marshal_to=self.marshal_to_sibling) accessors.XMLAttribute(property_name="cpus_num", libvirtxml=self, parent_xpath='/', tag_name='cpus', attribute='num') accessors.XMLElementList(property_name="cpu", libvirtxml=self, parent_xpath='/cpus', marshal_from=self.marshal_from_cpu, marshal_to=self.marshal_to_cpu) super(CellXML, self).__init__(virsh_instance) self.xml = u"<cell></cell>"
def __init__(self, virsh_instance=base.virsh): accessors.XMLAttribute(property_name='name', libvirtxml=self, parent_xpath='/', tag_name='enum', attribute='name') accessors.XMLElementList(property_name='values', libvirtxml=self, parent_xpath='/', marshal_from=self.marshal_from_values, marshal_to=self.marshal_to_values) super(EnumXML, self).__init__(virsh_instance=virsh_instance) self.xml = '<enum/>'
def __init__(self, virsh_instance=base.virsh): accessors.XMLElementList('vcpupins', self, parent_xpath='/', marshal_from=self.marshal_from_vcpupins, marshal_to=self.marshal_to_vcpupins) accessors.XMLAttribute('emulatorpin', self, parent_xpath='/', tag_name='emulatorpin', attribute='cpuset') for slot in self.__all_slots__: if slot in ('shares', 'period', 'quota', 'emulator_period', 'emulator_quota'): accessors.XMLElementInt(slot, self, parent_xpath='/', tag_name=slot) super(self.__class__, self).__init__(virsh_instance=virsh_instance) self.xml = '<cputune/>'
def __init__(self, virsh_instance=base.base.virsh): accessors.XMLAttribute(property_name="name", libvirtxml=self, forbidden=None, parent_xpath='/', tag_name='filterref', attribute='filter') accessors.XMLElementList(property_name='parameters', libvirtxml=self, parent_xpath='/', marshal_from=self.marshal_from_parameter, marshal_to=self.marshal_to_parameter) super(self.__class__, self).__init__(virsh_instance=virsh_instance) self.xml = '<filterref/>'
def __init__(self, virsh_instance=base.base.virsh): accessors.XMLAttribute(property_name="trunk", libvirtxml=self, forbidden=None, parent_xpath='/', tag_name='vlan', attribute='trunk') accessors.XMLElementList(property_name='tags', libvirtxml=self, parent_xpath='/', marshal_from=self.marshal_from_tag, marshal_to=self.marshal_to_tag) super(self.__class__, self).__init__(virsh_instance=virsh_instance) self.xml = '<vlan/>'
def __init__(self, virsh_instance=base.virsh): accessors.XMLElementText('name', self, parent_xpath='/', tag_name='name') accessors.XMLElementText('description', self, parent_xpath='/', tag_name='description') accessors.XMLElementList('disks', self, parent_xpath='/disks', marshal_from=self.marshal_from_disks, marshal_to=self.marshal_to_disks) super(self.__class__, self).__init__(virsh_instance=virsh_instance) self.xml = '<domaincheckpoint><disks/></domaincheckpoint>'
def __init__(self, type_name='pty', virsh_instance=base.virsh): 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(Console, self).__init__(device_tag='console', type_name=type_name, virsh_instance=virsh_instance)
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') accessors.XMLElementList('hosts', self, parent_xpath='/', marshal_from=self.marshal_from_host, marshal_to=self.marshal_to_host) accessors.XMLAttribute(property_name='auth_type', libvirtxml=self, parent_xpath='/', tag_name='auth', attribute='type') accessors.XMLAttribute(property_name='auth_username', libvirtxml=self, parent_xpath='/', tag_name='auth', attribute='username') accessors.XMLAttribute(property_name='secret_usage', libvirtxml=self, parent_xpath='/auth', tag_name='secret', attribute='usage') accessors.XMLAttribute(property_name='secret_uuid', libvirtxml=self, parent_xpath='/auth', tag_name='secret', attribute='uuid') super(SourceXML, self).__init__(virsh_instance=virsh_instance) self.xml = u"<source></source>"
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.XMLElementNest('hostdev_address', self, parent_xpath='/source', tag_name='address', subclass=self.Address, subclass_dargs={ 'type_name': 'pci', 'virsh_instance': virsh_instance }) accessors.XMLAttribute(property_name="managed", libvirtxml=self, forbidden=None, parent_xpath='/', tag_name='interface', attribute='managed') accessors.XMLElementDict(property_name="target", libvirtxml=self, forbidden=None, parent_xpath='/', tag_name='target') accessors.XMLElementDict(property_name="backend", libvirtxml=self, forbidden=None, parent_xpath='/', tag_name='backend') accessors.XMLAttribute(property_name="mac_address", libvirtxml=self, forbidden=None, parent_xpath='/', tag_name='mac', attribute='address') accessors.XMLAttribute(property_name="link_state", libvirtxml=self, forbidden=None, parent_xpath='/', tag_name='link', attribute='state') accessors.XMLAttribute(property_name="boot", libvirtxml=self, forbidden=None, parent_xpath='/', tag_name='boot', attribute='order') accessors.XMLElementNest( "bandwidth", self, parent_xpath='/', tag_name='bandwidth', subclass=self.Bandwidth, subclass_dargs={'virsh_instance': virsh_instance}) accessors.XMLElementNest( "driver", self, parent_xpath='/', tag_name='driver', subclass=self.Driver, subclass_dargs={'virsh_instance': virsh_instance}) accessors.XMLElementNest( "filterref", self, parent_xpath='/', tag_name='filterref', subclass=self.Filterref, subclass_dargs={'virsh_instance': virsh_instance}) accessors.XMLAttribute(property_name="model", libvirtxml=self, forbidden=None, parent_xpath='/', tag_name='model', attribute='type') accessors.XMLElementDict(property_name="coalesce", libvirtxml=self, forbidden=None, parent_xpath='/coalesce/rx', tag_name='frames') accessors.XMLElementDict(property_name="rom", libvirtxml=self, forbidden=None, parent_xpath='/', tag_name='rom') accessors.XMLElementDict(property_name="mtu", libvirtxml=self, forbidden=None, parent_xpath='/', tag_name='mtu') accessors.XMLElementNest('address', self, parent_xpath='/', tag_name='address', subclass=self.Address, subclass_dargs={ 'type_name': 'pci', 'virsh_instance': virsh_instance }) accessors.XMLAttribute('virtualport_type', self, parent_xpath='/', tag_name='virtualport', attribute='type') accessors.XMLElementDict('alias', self, parent_xpath='/', tag_name='alias') accessors.XMLElementList(property_name='ips', libvirtxml=self, forbidden=None, parent_xpath='/', marshal_from=self.marshal_from_ips, marshal_to=self.marshal_to_ips)