On 30.09.19 21:13, Andrej Utz wrote: > From: Ralf Ramsauer <ralf.ramsa...@oth-regensburg.de> > > No need to access our own tree, make this method static. This allows us to > fully seperate IORegionTree from IOMemRegionTree soon.
separate > > Signed-off-by: Ralf Ramsauer <ralf.ramsa...@oth-regensburg.de> > --- > pyjailhouse/sysfs_parser.py | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) > > diff --git a/pyjailhouse/sysfs_parser.py b/pyjailhouse/sysfs_parser.py > index b72be367..cbd6069d 100644 > --- a/pyjailhouse/sysfs_parser.py > +++ b/pyjailhouse/sysfs_parser.py > @@ -868,14 +868,15 @@ class IOMemRegionTree: > self.parent = None > self.children = [] > > - def regions_split_by_kernel(self): > - kernel = [x for x in self.children if > + @staticmethod > + def regions_split_by_kernel(tree): > + kernel = [x for x in tree.children if > x.region.typestr.startswith('Kernel ')] > > if len(kernel) == 0: > - return [self.region] > + return [tree.region] > > - r = self.region > + r = tree.region > s = r.typestr > > kernel_start = kernel[0].region.start > @@ -937,8 +938,8 @@ class IOMemRegionTree: > # System RAM on the first level will be added completely, > # if they don't contain the kernel itself, if they do, > # we split them > - if (tree.level == 1 and s == 'System RAM'): > - regions.extend(tree.regions_split_by_kernel()) > + if tree.level == 1 and s == 'System RAM': Missed in earlier cleanup? > + regions.extend(IOMemRegionTree.regions_split_by_kernel(tree)) > continue > > # blacklisted on all levels, covers both APIC and IOAPIC > Looks good otherwise. 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/fed9b1c5-397f-8370-9c11-36e866ec63a8%40siemens.com.