Skip to content

Commit

Permalink
Merge pull request avocado-framework#3401 from dzhengfy/enable_pmem_n…
Browse files Browse the repository at this point in the history
…vdimm

memory: add pmem alignsize to nvdimm
  • Loading branch information
Yingshun authored May 12, 2022
2 parents a33a072 + 3176cf8 commit 6394d23
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
3 changes: 3 additions & 0 deletions spell.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ nic
usb
vms
addr
alignsize
iothread
pid
scsi
Expand Down Expand Up @@ -588,6 +589,7 @@ pickable
preallocation
pubkey
pvresize
pmem
QDev
qom
readed
Expand Down Expand Up @@ -1360,6 +1362,7 @@ mkfifo
mkfs
mklost
MLS
mmap
mmio
mnt
modelname
Expand Down
29 changes: 23 additions & 6 deletions virttest/libvirt_xml/devices/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Target(base.base.LibvirtXMLBase):
__slots__ = ('size', 'size_unit', 'node', 'label',
'requested_size', 'requested_unit',
'current_size', 'current_unit',
'block_size', 'block_unit')
'block_size', 'block_unit', 'readonly')

def __init__(self, virsh_instance=base.base.virsh):
accessors.XMLElementInt('size',
Expand Down Expand Up @@ -111,6 +111,8 @@ def __init__(self, virsh_instance=base.base.virsh):
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/>'

Expand Down Expand Up @@ -148,12 +150,16 @@ class Source(base.base.LibvirtXMLBase):
Properties:
pagesize:
int.
pagesize_unit, nodemask:
string.
pagesize: int, override the default host page size used for backing the memory device
pagesize_unit: str, the unit of pagesize
nodemask: str, override the default set of NUMA nodes where the memory would be allocated
path: str, the path in the host that backs the memory device in the guest
alignsize: int, the page size alignment used to mmap the address range for the backend path
alignsize_unit: str, the unit of alignsize
pmem:boolean, persistent memory feature is enabled
"""
__slots__ = ('pagesize', 'pagesize_unit', 'nodemask', 'path')
__slots__ = ('pagesize', 'pagesize_unit', 'nodemask', 'path',
'alignsize', 'alignsize_unit', 'pmem')

def __init__(self, virsh_instance=base.base.virsh):
accessors.XMLElementInt('pagesize',
Expand All @@ -171,6 +177,17 @@ def __init__(self, virsh_instance=base.base.virsh):
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/>'

Expand Down

0 comments on commit 6394d23

Please sign in to comment.