Skip to contentSkip to conversation

scripts/dump-guest-memory.py: fix after RAMBlock change

PATCH In review Michael S. Tsirkin 2 participants 2 messages Aug 27, 2015 – Sep 7, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts/dump-guest-memory.py: fix after RAMBlock change

commit 9b8424d5735278ca382f11adc7c63072b632ab83

    "exec: split length -> used_length/max_length"

changed field names in struct RAMBlock

It turns out that scripts/dump-guest-memory.py was poking at this field, update it accordingly.

---
 scripts/dump-guest-memory.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/dump-guest-memory.py +1 -1
index dc8e44a..08796ff 100644
@@ -118,7 +118,7 @@ shape and this command should mostly work."""
     def qemu_get_ram_block(self, ram_addr):
         ram_blocks = gdb.parse_and_eval("ram_list.blocks")
         for block in self.qlist_foreach(ram_blocks, "next"):
-            if (ram_addr - block["offset"] < block["length"]):
+            if (ram_addr - block["offset"] < block["used_length"]):
                 return block
         raise gdb.GdbError("Bad ram offset %x" % ram_addr)
 
Signature · 1 line
MST
#1 lore raw
Quoted 20 lines · Michael S. Tsirkin

commit 9b8424d5735278ca382f11adc7c63072b632ab83

    "exec: split length -> used_length/max_length"

changed field names in struct RAMBlock

It turns out that scripts/dump-guest-memory.py was poking at this field, update it accordingly.

---
 scripts/dump-guest-memory.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/dump-guest-memory.py +0 -0
index dc8e44a..08796ff 100644

scripts/dump-guest-memory.py shape and this command should mostly work.""" · line 124

Quoted 8 lines
scripts/dump-guest-memory.py +1 -1
@@ -118,7 +118,7 @@ shape and this command should mostly work."""
     def qemu_get_ram_block(self, ram_addr):
         ram_blocks = gdb.parse_and_eval("ram_list.blocks")
         for block in self.qlist_foreach(ram_blocks, "next"):
-            if (ram_addr - block["offset"] < block["length"]):
+            if (ram_addr - block["offset"] < block["used_length"]):
                 return block
         raise gdb.GdbError("Bad ram offset %x" % ram_addr)
 

Thanks, queued for my next pull request.

Paolo