On 05/28/2010 11:19 AM, Gui Jianfeng wrote:
Gui Jianfeng wrote:
Hi all,
I made use of "virsh dump" to generate a dumpfile, but crash seems
fails at initializing time. I decode the dumpfile and found there's
a "block" header section, but seems crash doesn't support such
section so it failed. Am i missing something?
Any one can help? How can i make use of crash checking the dumpfile?
Sorry, I attached a stale version of the patch.
Dump files do not include disk state, so the bare minimum handling of
block sections should suffice.
Paolo
diff --git a/qemu-load.c b/qemu-load.c
index 7acff62..9e35866 100644
--- a/qemu-load.c
+++ b/qemu-load.c
@@ -243,6 +243,33 @@ ram_init_load (struct qemu_device_list *dl,
&ram, section_id, instance_id);
}
+
+#define BLK_MIG_FLAG_EOS 2
+
+static uint32_t
+block_load (struct qemu_device *d, FILE *fp, enum qemu_save_section sec)
+{
+ uint64_t header;
+
+ header = get_be64 (fp);
+ assert (header == BLK_MIG_FLAG_EOS);
+}
+
+static struct qemu_device *
+block_init_load (struct qemu_device_list *dl,
+ uint32_t section_id, uint32_t instance_id,
+ uint32_t version_id, bool live, FILE *fp)
+{
+ static struct qemu_device_vtbl block = {
+ "block",
+ block_load,
+ NULL
+ };
+
+ return device_alloc (dl, sizeof (struct qemu_device),
+ &block, section_id, instance_id);
+}
+
/* cpu_common loader. */
struct qemu_device_cpu_common {
@@ -551,6 +578,7 @@ const struct qemu_device_loader devices_x86_64[] = {
{ "cpu_common", cpu_common_init_load },
{ "kvm-tpr-opt", kvm_tpr_opt_init_load },
{ "cpu", cpu_init_load_64 },
+ { "block", block_init_load },
{ "ram", ram_init_load },
{ "timer", timer_init_load },
{ NULL }
@@ -560,6 +588,7 @@ const struct qemu_device_loader devices_x86_32[] = {
{ "cpu_common", cpu_common_init_load },
{ "kvm-tpr-opt", kvm_tpr_opt_init_load },
{ "cpu", cpu_init_load_32 },
+ { "block", block_init_load },
{ "ram", ram_init_load },
{ "timer", timer_init_load },
{ NULL }
--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility