From: Jan Kiszka <jan.kis...@siemens.com>

Avoid having to override the size method in PortRegion and rather do the
correct calculation in IORegion already. This does not affect the
rounding in MemRegion.size.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>
---
 pyjailhouse/sysfs_parser.py | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/pyjailhouse/sysfs_parser.py b/pyjailhouse/sysfs_parser.py
index 29c58b16..7c93b58e 100644
--- a/pyjailhouse/sysfs_parser.py
+++ b/pyjailhouse/sysfs_parser.py
@@ -910,7 +910,7 @@ class IORegion(object):
         return self.typestr
 
     def size(self):
-        return int(self.stop - self.start)
+        return int(self.stop - self.start + 1)
 
     def start_str(self):
         # This method is used in root-cell-config.c.tmpl
@@ -959,9 +959,6 @@ class PortRegion(IORegion):
         return 'Port I/O: %04x-%04x : %s' % \
             (self.start, self.stop, super(PortRegion, self).__str__())
 
-    def size(self):
-        return super(PortRegion, self).size() + 1
-
 
 class IOAPIC:
     def __init__(self, id, address, gsi_base, iommu=0, bdf=0):
-- 
2.26.2

-- 
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/2403bc4d3d0aac83ff0732ed24ce4473744f1322.1599473999.git.jan.kiszka%40siemens.com.

Reply via email to