|
|
9ae3a8 |
From e105226b0203159f15fc932eac668c67686ec923 Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
|
|
|
9ae3a8 |
Date: Wed, 13 Dec 2017 13:38:54 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 23/41] dump-guest-memory: cleanup: removing
|
|
|
9ae3a8 |
dump_{error|cleanup}().
|
|
|
9ae3a8 |
MIME-Version: 1.0
|
|
|
9ae3a8 |
Content-Type: text/plain; charset=UTF-8
|
|
|
9ae3a8 |
Content-Transfer-Encoding: 8bit
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
9ae3a8 |
Message-id: <20171213133912.26176-24-marcandre.lureau@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 78372
|
|
|
9ae3a8 |
O-Subject: [RHEL-7.5 qemu-kvm PATCH v3 23/41] dump-guest-memory: cleanup: removing dump_{error|cleanup}().
|
|
|
9ae3a8 |
Bugzilla: 1411490
|
|
|
9ae3a8 |
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
From: Peter Xu <peterx@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
It might be a little bit confusing and error prone to do
|
|
|
9ae3a8 |
dump_cleanup() in these two functions. A better way is to do
|
|
|
9ae3a8 |
dump_cleanup() before dump finish, no matter whether dump has
|
|
|
9ae3a8 |
succeeded or not.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Peter Xu <peterx@redhat.com>
|
|
|
9ae3a8 |
Reviewed-by: Fam Zheng <famz@redhat.com>
|
|
|
9ae3a8 |
Message-Id: <1455772616-8668-2-git-send-email-peterx@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
(cherry picked from commit e3517a529913a2a48c12ba8eef4975ad561af97c)
|
|
|
9ae3a8 |
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
dump.c | 78 +++++++++++++++++++++++++++---------------------------------------
|
|
|
9ae3a8 |
1 file changed, 32 insertions(+), 46 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/dump.c b/dump.c
|
|
|
9ae3a8 |
index a359c29..790bfe4 100644
|
|
|
9ae3a8 |
--- a/dump.c
|
|
|
9ae3a8 |
+++ b/dump.c
|
|
|
9ae3a8 |
@@ -81,12 +81,6 @@ static int dump_cleanup(DumpState *s)
|
|
|
9ae3a8 |
return 0;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-static void dump_error(DumpState *s, const char *reason, Error **errp)
|
|
|
9ae3a8 |
-{
|
|
|
9ae3a8 |
- dump_cleanup(s);
|
|
|
9ae3a8 |
- error_setg(errp, "%s", reason);
|
|
|
9ae3a8 |
-}
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
static int fd_write_vmcore(const void *buf, size_t size, void *opaque)
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
DumpState *s = opaque;
|
|
|
9ae3a8 |
@@ -127,7 +121,7 @@ static void write_elf64_header(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
ret = fd_write_vmcore(&elf_header, sizeof(elf_header), s);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to write elf header", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to write elf header");
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -158,7 +152,7 @@ static void write_elf32_header(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
ret = fd_write_vmcore(&elf_header, sizeof(elf_header), s);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to write elf header", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to write elf header");
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -181,7 +175,7 @@ static void write_elf64_load(DumpState *s, MemoryMapping *memory_mapping,
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
ret = fd_write_vmcore(&phdr, sizeof(Elf64_Phdr), s);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to write program header table", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to write program header table");
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -204,7 +198,7 @@ static void write_elf32_load(DumpState *s, MemoryMapping *memory_mapping,
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
ret = fd_write_vmcore(&phdr, sizeof(Elf32_Phdr), s);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to write program header table", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to write program header table");
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -224,7 +218,7 @@ static void write_elf64_note(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
ret = fd_write_vmcore(&phdr, sizeof(Elf64_Phdr), s);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to write program header table", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to write program header table");
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -246,7 +240,7 @@ static void write_elf64_notes(WriteCoreDumpFunction f, DumpState *s,
|
|
|
9ae3a8 |
id = cpu_index(cpu);
|
|
|
9ae3a8 |
ret = cpu_write_elf64_note(f, cpu, id, s);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to write elf notes", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to write elf notes");
|
|
|
9ae3a8 |
return;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
@@ -255,7 +249,7 @@ static void write_elf64_notes(WriteCoreDumpFunction f, DumpState *s,
|
|
|
9ae3a8 |
cpu = ENV_GET_CPU(env);
|
|
|
9ae3a8 |
ret = cpu_write_elf64_qemunote(f, cpu, s);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to write CPU status", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to write CPU status");
|
|
|
9ae3a8 |
return;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
@@ -277,7 +271,7 @@ static void write_elf32_note(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
ret = fd_write_vmcore(&phdr, sizeof(Elf32_Phdr), s);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to write program header table", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to write program header table");
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -294,7 +288,7 @@ static void write_elf32_notes(WriteCoreDumpFunction f, DumpState *s,
|
|
|
9ae3a8 |
id = cpu_index(cpu);
|
|
|
9ae3a8 |
ret = cpu_write_elf32_note(f, cpu, id, s);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to write elf notes", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to write elf notes");
|
|
|
9ae3a8 |
return;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
@@ -303,7 +297,7 @@ static void write_elf32_notes(WriteCoreDumpFunction f, DumpState *s,
|
|
|
9ae3a8 |
cpu = ENV_GET_CPU(env);
|
|
|
9ae3a8 |
ret = cpu_write_elf32_qemunote(f, cpu, s);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to write CPU status", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to write CPU status");
|
|
|
9ae3a8 |
return;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
@@ -331,7 +325,7 @@ static void write_elf_section(DumpState *s, int type, Error **errp)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
ret = fd_write_vmcore(&shdr, shdr_size, s);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to write section header table", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to write section header table");
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -341,7 +335,7 @@ static void write_data(DumpState *s, void *buf, int length, Error **errp)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
ret = fd_write_vmcore(buf, length, s);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to save memory", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to save memory");
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -573,11 +567,6 @@ static void dump_begin(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-static void dump_completed(DumpState *s)
|
|
|
9ae3a8 |
-{
|
|
|
9ae3a8 |
- dump_cleanup(s);
|
|
|
9ae3a8 |
-}
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
static int get_next_block(DumpState *s, GuestPhysBlock *block)
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
while (1) {
|
|
|
9ae3a8 |
@@ -629,8 +618,6 @@ static void dump_iterate(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
} while (!get_next_block(s, block));
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
- dump_completed(s);
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
static void create_vmcore(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
@@ -770,7 +757,7 @@ static void create_header32(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
dh->status = cpu_to_dump32(s, status);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
if (write_buffer(s->fd, 0, dh, size) < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to write disk dump header", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to write disk dump header");
|
|
|
9ae3a8 |
goto out;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -789,7 +776,7 @@ static void create_header32(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
if (write_buffer(s->fd, DISKDUMP_HEADER_BLOCKS *
|
|
|
9ae3a8 |
block_size, kh, size) < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to write kdump sub header", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to write kdump sub header");
|
|
|
9ae3a8 |
goto out;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -805,7 +792,7 @@ static void create_header32(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
if (write_buffer(s->fd, offset_note, s->note_buf,
|
|
|
9ae3a8 |
s->note_size) < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to write notes", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to write notes");
|
|
|
9ae3a8 |
goto out;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -870,7 +857,7 @@ static void create_header64(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
dh->status = cpu_to_dump32(s, status);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
if (write_buffer(s->fd, 0, dh, size) < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to write disk dump header", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to write disk dump header");
|
|
|
9ae3a8 |
goto out;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -889,7 +876,7 @@ static void create_header64(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
if (write_buffer(s->fd, DISKDUMP_HEADER_BLOCKS *
|
|
|
9ae3a8 |
block_size, kh, size) < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to write kdump sub header", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to write kdump sub header");
|
|
|
9ae3a8 |
goto out;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -906,7 +893,7 @@ static void create_header64(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
if (write_buffer(s->fd, offset_note, s->note_buf,
|
|
|
9ae3a8 |
s->note_size) < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to write notes", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to write notes");
|
|
|
9ae3a8 |
goto out;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -1092,7 +1079,7 @@ static void write_dump_bitmap(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
while (get_next_page(&block_iter, &pfn, NULL, s)) {
|
|
|
9ae3a8 |
ret = set_dump_bitmap(last_pfn, pfn, true, dump_bitmap_buf, s);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to set dump_bitmap", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to set dump_bitmap");
|
|
|
9ae3a8 |
goto out;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -1109,7 +1096,7 @@ static void write_dump_bitmap(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
ret = set_dump_bitmap(last_pfn, last_pfn + bits_per_buf, false,
|
|
|
9ae3a8 |
dump_bitmap_buf, s);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to sync dump_bitmap", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to sync dump_bitmap");
|
|
|
9ae3a8 |
goto out;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
@@ -1242,7 +1229,7 @@ static void write_dump_pages(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
ret = write_cache(&page_data, buf, s->dump_info.page_size, false);
|
|
|
9ae3a8 |
g_free(buf);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to write page data (zero page)", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to write page data (zero page)");
|
|
|
9ae3a8 |
goto out;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -1258,7 +1245,7 @@ static void write_dump_pages(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
ret = write_cache(&page_desc, &pd_zero, sizeof(PageDescriptor),
|
|
|
9ae3a8 |
false);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to write page desc", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to write page desc");
|
|
|
9ae3a8 |
goto out;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
} else {
|
|
|
9ae3a8 |
@@ -1283,7 +1270,7 @@ static void write_dump_pages(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
ret = write_cache(&page_data, buf_out, size_out, false);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to write page data", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to write page data");
|
|
|
9ae3a8 |
goto out;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
#ifdef CONFIG_LZO
|
|
|
9ae3a8 |
@@ -1296,7 +1283,7 @@ static void write_dump_pages(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
ret = write_cache(&page_data, buf_out, size_out, false);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to write page data", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to write page data");
|
|
|
9ae3a8 |
goto out;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
#endif
|
|
|
9ae3a8 |
@@ -1310,7 +1297,7 @@ static void write_dump_pages(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
ret = write_cache(&page_data, buf_out, size_out, false);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to write page data", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to write page data");
|
|
|
9ae3a8 |
goto out;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
#endif
|
|
|
9ae3a8 |
@@ -1326,7 +1313,7 @@ static void write_dump_pages(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
ret = write_cache(&page_data, buf,
|
|
|
9ae3a8 |
s->dump_info.page_size, false);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to write page data", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to write page data");
|
|
|
9ae3a8 |
goto out;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
@@ -1338,7 +1325,7 @@ static void write_dump_pages(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
ret = write_cache(&page_desc, &pd, sizeof(PageDescriptor), false);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to write page desc", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to write page desc");
|
|
|
9ae3a8 |
goto out;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
@@ -1346,12 +1333,12 @@ static void write_dump_pages(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
ret = write_cache(&page_desc, NULL, 0, true);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to sync cache for page_desc", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to sync cache for page_desc");
|
|
|
9ae3a8 |
goto out;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
ret = write_cache(&page_data, NULL, 0, true);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to sync cache for page_data", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to sync cache for page_data");
|
|
|
9ae3a8 |
goto out;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -1395,7 +1382,7 @@ static void create_kdump_vmcore(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
ret = write_start_flat_header(s->fd);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to write start flat header", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to write start flat header");
|
|
|
9ae3a8 |
return;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -1419,11 +1406,9 @@ static void create_kdump_vmcore(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
ret = write_end_flat_header(s->fd);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- dump_error(s, "dump: failed to write end flat header", errp);
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: failed to write end flat header");
|
|
|
9ae3a8 |
return;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
- dump_completed(s);
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
static ram_addr_t get_start_block(DumpState *s)
|
|
|
9ae3a8 |
@@ -1711,6 +1696,7 @@ void qmp_dump_guest_memory(bool paging, const char *file, bool has_begin,
|
|
|
9ae3a8 |
create_vmcore(s, errp);
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
+ dump_cleanup(s);
|
|
|
9ae3a8 |
g_free(s);
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.8.3.1
|
|
|
9ae3a8 |
|