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 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):
29 self
._src
_mem
_bind
= src_mem_bind
# List of NUMA nodes
30 self
._src
_cpu
_bind
= src_cpu_bind
# List of pCPUs
31 self
._dst
_mem
_bind
= dst_mem_bind
# List of NUMA nodes
32 self
._dst
_cpu
_bind
= dst_cpu_bind
# List of pCPUs
33 self
._prealloc
_pages
= prealloc_pages
34 self
._huge
_pages
= huge_pages
35 self
._locked
_pages
= locked_pages
42 "src_mem_bind": self
._src
_mem
_bind
,
43 "dst_mem_bind": self
._dst
_mem
_bind
,
44 "src_cpu_bind": self
._src
_cpu
_bind
,
45 "dst_cpu_bind": self
._dst
_cpu
_bind
,
46 "prealloc_pages": self
._prealloc
_pages
,
47 "huge_pages": self
._huge
_pages
,
48 "locked_pages": self
._locked
_pages
,
52 def deserialize(cls
, data
):
60 data
["prealloc_pages"],