[Crash-utility] [PATCH 2/2] qemu: parse 'vm_footer' section

Pankaj Gupta pagupta at redhat.com
Mon May 16 13:47:43 UTC 2016


 Parse 'QEMU_VM_SECTION_FOOTER' in crash. This section is also
 added by VM migration code to avoid misparsing.

Signed-off-by: Pankaj Gupta <pagupta at redhat.com>
---
 qemu-load.c | 4 ++++
 qemu-load.h | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/qemu-load.c b/qemu-load.c
index 7ee58a3..4b8313d 100644
--- a/qemu-load.c
+++ b/qemu-load.c
@@ -972,6 +972,10 @@ qemu_load (const struct qemu_device_loader *devices, uint32_t required_features,
 			break;
 		if (sec == QEMU_VM_EOF)
 			break;
+		if (sec == QEMU_VM_SECTION_FOOTER) {
+			uint32_t footerSecId = get_be32 (fp);
+			continue;
+                }
 		if (sec == QEMU_VM_CONFIGURATION) {
 			uint32_t len = get_be32 (fp);
 			get_string_len (fp, name, len);
diff --git a/qemu-load.h b/qemu-load.h
index d5b2078..f4fbb06 100644
--- a/qemu-load.h
+++ b/qemu-load.h
@@ -30,7 +30,8 @@ enum qemu_save_section {
   QEMU_VM_SECTION_END,
   QEMU_VM_SECTION_FULL,
   QEMU_VM_SUBSECTION,
-  QEMU_VM_CONFIGURATION = 0x07
+  QEMU_VM_CONFIGURATION = 0x07,
+  QEMU_VM_SECTION_FOOTER = 0x7e
 };
 
 enum qemu_features {
-- 
1.9.3




More information about the Crash-utility mailing list