On 08.09.20 01:15, Andrej Utz wrote:
> Hi Jan,
> 
> On 27/08/2020 11:33, Jan Kiszka wrote:
>> On 25.08.20 16:50, Andrej Utz wrote:
>>> Theses patches mostly improve non-functional aspects of the Jailhouse
>>> configuration parser. Logic for unpacking binary data is consolidated
>>> into CStruct class, which all parser classes are inherited from.
>>> To improve input flexibility, data slices are replaced with I/O streams
>>> (see Pythons 'io' package for how to use them).
>>> Finally, a CPU set check is added, which will list conflicting CPUs
>>> between cells and also usage of non-existing ones in the root-cell.
>>>
>>> Changes v2->v3:
>>>    - fix config_parser usage in jailhouse-cell-linux
>>>    - fix output style in "CPU checks" commit
>>>
>>> Changes v1->v2:
>>>    - reference class variables via class object or class name
>>>    - drop implicit PEP8 formatting
>>>    - dropped unused patches
>>>
>>> Andrej Utz (7):
>>>    pyjailhouse: config_parser: store binary format specification in
>>>      struct.Struct
>>>    pyjailhouse: config_parser: move parsing into class methods
>>>    pyjailhouse: config_parser: consolidate binary parsing into CStruct
>>>      class
>>>    pyjailhouse: config_parser: use I/O stream instead slice of bytes
>>>    pyjailhouse: config_parser: parse pin_bitman in Irqchip as list
>>>    pyjailhouse: config_parser: consolidate header parsing
>>>    tools: config-check: add CPU overlap and boundary check
>>>
>>>   pyjailhouse/config_parser.py | 296 ++++++++++++++++++++++-------------
>>>   tools/jailhouse-cell-linux   |   2 +-
>>>   tools/jailhouse-config-check |  33 +++-
>>>   3 files changed, 215 insertions(+), 116 deletions(-)
>>>
>>> -- 
>>> 2.28.0
>>>
>>
>> Still doesn't work - did you test jailhouse cell linux?
> 
> I did and it works... with Python 3.
> 
>> Traceback (most recent call last):
>>    File "jailhouse/tools/jailhouse-cell-linux", line 723, in <module>
>>      config = config_parser.parse(args.config, config_parser.CellConfig)
>>    File "jailhouse/tools/../pyjailhouse/config_parser.py", line 287,
>> in parse
>>      return config_expect.parse(stream)
>>    File "jailhouse/tools/../pyjailhouse/config_parser.py", line 220,
>> in parse
>>      cpu_set_num = int(self.cpu_set / cpu_fmt.size)
>> TypeError: unsupported operand type(s) for /: 'set' and 'int'
> 
> When using Python 2, the slots of the child classes are not updated with
> cell config data. I'll search for a workaround.
> 
> By the way: how long will Jailhouse require Python 2 compatibility?

I'm fine with switching ("#!/usr/bin/env python3"), but then someone
should also scan the git history and/or code for obsolete compat patterns.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jailhouse-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/7e4900c1-9d76-34de-f7b4-5f396b72cac0%40siemens.com.

Reply via email to