[Crash-utility] [PATCH] add support to "virsh dump-guest-memory"(qemu memory dump)

anderson at prospeed.net anderson at prospeed.net
Fri Jul 20 14:32:00 UTC 2012


> Hello Dave,
>
> I made this patch to make crash can analyze core dump file created by
> "virsh dump-guest-memory"(I will call it "qemu memory dump" below). In
> my test(guest OS: RHEL6.2 x86 & x86_64), the patch works well with dump
> files created by "qemu memory dump".
>
> However, after some investigation, I think I need to discuss further
> works with you.
>
> The core dump created by qemu memory dump is similar to kdump. The
> distinctness only focuses on note sections. The former one gets
> note sections with a name called "QEMU".
>
> 1. Some registers' information stored in "CORE" note sections, needed
> by crash, also stores in "QEMU" note sections. I think it's not
> reasonable to replace them. What do you think?
>
> 2. Other registers which are only stored in "QEMU" note sections are
> not directly used in crash. I will continue investigating the use of
> these registers. And if you give some suggestion, it will be helpful.
>
> --
> --
> Regards
> Qiao Nuohan

Qiao,

I'm sending this from my home email address -- I am going to be
on vacation for the next two weeks, and will have limited internet
access during that time.  So I won't be able to look at this
patch in detail until the week of August 6th.

Anyway, one thing about the patch that I don't like is this
flags/flags2 usage:

 #define NETDUMP_DUMPFILE()  (pc->flags & (NETDUMP|REM_NETDUMP))
 #define DISKDUMP_DUMPFILE() (pc->flags & DISKDUMP)
 #define KDUMP_DUMPFILE()    (pc->flags & KDUMP)
+#define QEMU_MEM_DUMP_DUMPFILE() ((pc->flags & NETDUMP) && (pc->flags2 &
QEMU_MEM_DUMP))
 #define XENDUMP_DUMPFILE()  (pc->flags & XENDUMP)
 #define XEN_HYPER_MODE()    (pc->flags & XEN_HYPER)

None of the other individual dumpfile types "share" a flag with
any other dumpfile type.  And so having *both* the NETDUMP flag
*and* the QEMU_MEM_DUMP_DUMPFILE flags set at the same time makes
no sense.  It's simply *not* a NETDUMP, and all of the locations
where you do something like this are needlessly confusing:

+                else if (pc->flags & NETDUMP) {
+			if (pc->flags2 & QEMU_MEM_DUMP)
+				retval = qemu_mem_dump_memory_dump(fp);
+			else
+                        	retval = netdump_memory_dump(fp);
+		}

It may have somehow made your patch easier, but please re-work it
such that QEMU_MEM_DUMP_DUMPFILE() only relies on a single flag bit.

Also, when I get back to work, perhaps you can also make a small sample
dumpfile available to me to test your patch with.

Thanks,
  Dave Anderson




More information about the Crash-utility mailing list