]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
tools: Close files after use in config generator
authorJan Kiszka <jan.kiszka@siemens.com>
Wed, 28 Jan 2015 09:58:58 +0000 (10:58 +0100)
committerJan Kiszka <jan.kiszka@siemens.com>
Sun, 1 Feb 2015 11:47:10 +0000 (12:47 +0100)
Just to be clean and to avoid piling up unused resources. In some cases
we already did so, in one we were using the with statement. Now the
remaining perform the close as well.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
tools/jailhouse-config-create

index 4df0518438693f46e40c2ad2cca104c81714349c..c3eebbe10f524a39795a5d6bae856abff24a3a2d 100755 (executable)
@@ -213,6 +213,7 @@ class PCICapability:
             content = f.read(len - 2)
             caps.append(PCICapability(id, cap, len, flags, content,
                                       msix_address))
+        f.close()
         return caps
 
 
@@ -597,6 +598,7 @@ def parse_madt():
 
         f.seek(struct_len - offset, os.SEEK_CUR)
 
+    f.close()
     return ioapics
 
 
@@ -699,6 +701,7 @@ def parse_dmar(pcidevices, ioapics):
 
         f.seek(struct_len - offset, os.SEEK_CUR)
 
+    f.close()
     return units, regions