2 # Migration test hardware configuration description
4 # Copyright (c) 2016 Red Hat, Inc.
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License, or (at your option) any later version.
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, see <http://www.gnu.org/licenses/>.
21 class Hardware(object):
22 def __init__(self
, cpus
=1, mem
=1,
23 src_cpu_bind
=None, src_mem_bind
=None,
24 dst_cpu_bind
=None, dst_mem_bind
=None,
25 prealloc_pages
= False,
26 huge_pages
=False, locked_pages
=False,
30 self
._src
_mem
_bind
= src_mem_bind
# List of NUMA nodes
31 self
._src
_cpu
_bind
= src_cpu_bind
# List of pCPUs
32 self
._dst
_mem
_bind
= dst_mem_bind
# List of NUMA nodes
33 self
._dst
_cpu
_bind
= dst_cpu_bind
# List of pCPUs
34 self
._prealloc
_pages
= prealloc_pages
35 self
._huge
_pages
= huge_pages
36 self
._locked
_pages
= locked_pages
37 self
._dirty
_ring
_size
= dirty_ring_size
44 "src_mem_bind": self
._src
_mem
_bind
,
45 "dst_mem_bind": self
._dst
_mem
_bind
,
46 "src_cpu_bind": self
._src
_cpu
_bind
,
47 "dst_cpu_bind": self
._dst
_cpu
_bind
,
48 "prealloc_pages": self
._prealloc
_pages
,
49 "huge_pages": self
._huge
_pages
,
50 "locked_pages": self
._locked
_pages
,
51 "dirty_ring_size": self
._dirty
_ring
_size
,
55 def deserialize(cls
, data
):
63 data
["prealloc_pages"],
66 data
["dirty_ring_size"])