[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 06/32] dump: add API to write vmcore
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PULL 06/32] dump: add API to write vmcore |
Date: |
Mon, 3 Mar 2014 12:11:57 -0500 |
From: qiaonuohan <address@hidden>
Function is used to write vmcore in flatten format. In flatten format, data is
written block by block, and in front of each block, a struct
MakedumpfileDataHeader is stored there to indicate the offset and size of the
data block.
struct MakedumpfileDataHeader {
int64_t offset;
int64_t buf_size;
};
Signed-off-by: Qiao Nuohan <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>
---
dump.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/dump.c b/dump.c
index f233b3e..238ffa5 100644
--- a/dump.c
+++ b/dump.c
@@ -728,6 +728,27 @@ static int write_end_flat_header(int fd)
return 0;
}
+static int write_buffer(int fd, off_t offset, const void *buf, size_t size)
+{
+ size_t written_size;
+ MakedumpfileDataHeader mdh;
+
+ mdh.offset = cpu_to_be64(offset);
+ mdh.buf_size = cpu_to_be64(size);
+
+ written_size = qemu_write_full(fd, &mdh, sizeof(mdh));
+ if (written_size != sizeof(mdh)) {
+ return -1;
+ }
+
+ written_size = qemu_write_full(fd, buf, size);
+ if (written_size != size) {
+ return -1;
+ }
+
+ return 0;
+}
+
static ram_addr_t get_start_block(DumpState *s)
{
GuestPhysBlock *block;
--
1.8.1.4
- [Qemu-devel] [PULL 00/32] QMP queue, Luiz Capitulino, 2014/03/03
- [Qemu-devel] [PULL 02/32] MAINTAINERS: update status for HMP, QAPI and QMP trees, Luiz Capitulino, 2014/03/03
- [Qemu-devel] [PULL 01/32] QMP: Allow dot separated dict path arguments in qmp-shell, Luiz Capitulino, 2014/03/03
- [Qemu-devel] [PULL 04/32] dump: add argument to write_elfxx_notes, Luiz Capitulino, 2014/03/03
- [Qemu-devel] [PULL 07/32] dump: add API to write elf notes to buffer, Luiz Capitulino, 2014/03/03
- [Qemu-devel] [PULL 08/32] dump: add support for lzo/snappy, Luiz Capitulino, 2014/03/03
- [Qemu-devel] [PULL 09/32] dump: add members to DumpState and init some of them, Luiz Capitulino, 2014/03/03
- [Qemu-devel] [PULL 05/32] dump: add API to write header of flatten format, Luiz Capitulino, 2014/03/03
- [Qemu-devel] [PULL 11/32] dump: add API to write dump_bitmap, Luiz Capitulino, 2014/03/03
- [Qemu-devel] [PULL 06/32] dump: add API to write vmcore,
Luiz Capitulino <=
- [Qemu-devel] [PULL 12/32] dump: add APIs to operate DataCache, Luiz Capitulino, 2014/03/03
- [Qemu-devel] [PULL 10/32] dump: add API to write dump header, Luiz Capitulino, 2014/03/03
- [Qemu-devel] [PULL 03/32] dump: const-qualify the buf of WriteCoreDumpFunction, Luiz Capitulino, 2014/03/03
- [Qemu-devel] [PULL 14/32] dump: make kdump-compressed format available for 'dump-guest-memory', Luiz Capitulino, 2014/03/03
- [Qemu-devel] [PULL 13/32] dump: add API to write dump pages, Luiz Capitulino, 2014/03/03
- [Qemu-devel] [PULL 15/32] Define the architecture for compressed dump format, Luiz Capitulino, 2014/03/03
- [Qemu-devel] [PULL 16/32] dump: add 'query-dump-guest-memory-capability' command, Luiz Capitulino, 2014/03/03
- [Qemu-devel] [PULL 17/32] qmp: Check for returned data from __json_read in get_events, Luiz Capitulino, 2014/03/03
- [Qemu-devel] [PULL 19/32] monitor: Remove left-over code in do_info_profile., Luiz Capitulino, 2014/03/03