def __init__(self, virsh_instance=base.virsh, vm_name='', mode='host-model'): """ Create new VMCPU XML instance """ # The set action is for test. accessors.XMLElementText(property_name="model", libvirtxml=self, forbidden=['del'], parent_xpath='/cpu', tag_name='model') accessors.XMLElementText(property_name="vendor", libvirtxml=self, forbidden=['del'], parent_xpath='/cpu', tag_name='vendor') # This will skip self.get_feature_list() defined below accessors.AllForbidden(property_name="feature_list", libvirtxml=self) super(VMCPUXML, self).__init__(virsh_instance=virsh_instance) # Setup some bare-bones XML to build upon self.set_cpu_mode(vm_name, mode) self['xml'] = self.__dict_get__('virsh').dumpxml( vm_name, extra="--update-cpu").stdout.strip()
def __init__(self, virsh_instance=base.virsh): accessors.XMLAttribute('secret_ephemeral', self, parent_xpath='/', tag_name='secret', attribute='ephemeral') accessors.XMLAttribute('secret_private', self, parent_xpath='/', tag_name='secret', attribute='private') accessors.XMLElementText('uuid', self, parent_xpath='/', tag_name='uuid') accessors.XMLElementText('description', self, parent_xpath='/', tag_name='description') accessors.XMLAttribute('usage', self, parent_xpath='/', tag_name='usage', attribute='type') accessors.XMLElementText('volume', self, parent_xpath='/usage', tag_name='volume') super(SecretXMLBase, self).__init__(virsh_instance=virsh_instance)
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)
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)
def __init__(self, virsh_instance=base.virsh): accessors.XMLElementText('snap_name', self, parent_xpath='/', tag_name='name') accessors.XMLElementText('description', self, parent_xpath='/', tag_name='description') accessors.XMLAttribute('mem_snap_type', self, parent_xpath='/', tag_name='memory', attribute='snapshot') accessors.XMLAttribute('mem_file', self, parent_xpath='/', tag_name='memory', attribute='file') accessors.XMLElementText('creation_time', self, parent_xpath='/', tag_name='creationTime') accessors.XMLElementText('state', self, parent_xpath='/', tag_name='state') accessors.XMLElementText('parent_name', self, parent_xpath='/parent', tag_name='name') super(SnapshotXMLBase, self).__init__(virsh_instance=virsh_instance)
def __init__(self, virsh_instance=base.virsh): accessors.XMLElementText('block', self, parent_xpath='/', tag_name='block') accessors.XMLElementText('bus', self, parent_xpath='/', tag_name='bus') accessors.XMLElementText('driver_type', self, parent_xpath='/', tag_name='driver_type')
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)
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, virsh_instance=base.virsh): accessors.XMLElementText('name', self, parent_xpath='/', tag_name='name') accessors.XMLElementText('uuid', self, parent_xpath='/', tag_name='uuid') accessors.XMLAttribute('fwd_mode', self, parent_xpath='/', tag_name='forward', attribute='mode') accessors.XMLAttribute('mac', self, parent_xpath='/', tag_name='mac', attribute='address') 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') super(NetworkXMLBase, self).__init__(virsh_instance=virsh_instance)
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_os_arch_machine_map() defined below accessors.AllForbidden(property_name="os_arch_machine_map", 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') # This will skip self.get_feature_list() defined below accessors.AllForbidden(property_name="feature_list", libvirtxml=self) super(CapabilityXML, self).__init__(virsh_instance) # calls set_xml accessor method self['xml'] = self.dict_get('virsh').capabilities()
def __init__(self, virsh_instance=base.base.virsh): accessors.XMLElementInt('pagesize', self, parent_xpath='/', tag_name='pagesize') accessors.XMLAttribute(property_name="pagesize_unit", libvirtxml=self, forbidden=None, parent_xpath='/', tag_name='pagesize', attribute='unit') accessors.XMLElementText('nodemask', self, parent_xpath='/', tag_name='nodemask') accessors.XMLElementText('path', self, parent_xpath='/', tag_name='path') accessors.XMLElementInt('alignsize', self, parent_xpath='/', tag_name='alignsize') accessors.XMLAttribute(property_name="alignsize_unit", libvirtxml=self, forbidden=None, parent_xpath='/', tag_name='alignsize', attribute='unit') accessors.XMLElementBool('pmem', self, parent_xpath='/', tag_name='pmem') super(self.__class__, self).__init__(virsh_instance=virsh_instance) self.xml = '<source/>'
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')
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') super(NodedevXMLBase, self).__init__(virsh_instance=virsh_instance) self.xml = '<device></device>'
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)
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') super(self.__class__, self).__init__(virsh_instance=virsh_instance) self.xml = u'<owner></owner>'
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>')
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()
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>'
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.XMLElementText('path', self, parent_xpath='/target', tag_name='path') super(VolXMLBase, self).__init__(virsh_instance=virsh_instance)
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>'
def __init__(self, virsh_instance=base.base.virsh): accessors.XMLElementText('path', self, parent_xpath='/', tag_name='emulator') super(Emulator, self).__init__(device_tag='emulator', virsh_instance=virsh_instance)
def __init__(self, virsh_instance, text=None): accessors.XMLElementText('text', self, parent_xpath='/', tag_name='whatchamacallit') # pylint: disable=E1003 super(Whatchamacallit, self).__init__(virsh_instance=virsh_instance) self.xml = "<whatchamacallit></whatchamacallit>" self.text = str(text)
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.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, 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')
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, virsh_instance=base.virsh): accessors.XMLElementText(property_name='value', libvirtxml=self, parent_xpath='/', tag_name='value') super(ValueXML, self).__init__(virsh_instance=virsh_instance) self.xml = '<value/>'
def __init__(self, virsh_instance=base.virsh): accessors.XMLAttribute('type_id', self, parent_xpath='/', tag_name='type', attribute='id') accessors.XMLElementText('uuid', self, parent_xpath='/', tag_name='uuid') super(MdevXML, self).__init__(virsh_instance=virsh_instance) self.xml = (' <capability type=\'mdev\'></capability>')
def __init__(self, virsh_instance=base.virsh): """ Create new HostnameXML instance """ accessors.XMLElementText('hostname', self, parent_xpath='/', tag_name='hostname') super(DNSXML.HostnameXML, self).__init__( virsh_instance=virsh_instance) self.xml = '<hostname/>'