bool has_filter;
int64_t begin;
int64_t length;
- Error **errp;
uint8_t *note_buf; /* buffer for notes */
size_t note_buf_offset; /* the writing place in note_buf */
nr_cpus++;
}
- s->errp = errp;
s->fd = fd;
s->has_filter = has_filter;
s->begin = begin;
}
if (has_format && format != DUMP_GUEST_MEMORY_FORMAT_ELF) {
- if (create_kdump_vmcore(s) < 0 && !error_is_set(s->errp)) {
+ if (create_kdump_vmcore(s) < 0) {
error_set(errp, QERR_IO_ERROR);
}
} else {
- if (create_vmcore(s) < 0 && !error_is_set(s->errp)) {
+ if (create_vmcore(s) < 0) {
error_set(errp, QERR_IO_ERROR);
}
}
g_free(s);
}
+
+DumpGuestMemoryCapability *qmp_query_dump_guest_memory_capability(Error **errp)
+{
+ DumpGuestMemoryFormatList *item;
+ DumpGuestMemoryCapability *cap =
+ g_malloc0(sizeof(DumpGuestMemoryCapability));
+
+ /* elf is always available */
+ item = g_malloc0(sizeof(DumpGuestMemoryFormatList));
+ cap->formats = item;
+ item->value = DUMP_GUEST_MEMORY_FORMAT_ELF;
+
+ /* kdump-zlib is always available */
+ item->next = g_malloc0(sizeof(DumpGuestMemoryFormatList));
+ item = item->next;
+ item->value = DUMP_GUEST_MEMORY_FORMAT_KDUMP_ZLIB;
+
+ /* add new item if kdump-lzo is available */
+#ifdef CONFIG_LZO
+ item->next = g_malloc0(sizeof(DumpGuestMemoryFormatList));
+ item = item->next;
+ item->value = DUMP_GUEST_MEMORY_FORMAT_KDUMP_LZO;
+#endif
+
+ /* add new item if kdump-snappy is available */
+#ifdef CONFIG_SNAPPY
+ item->next = g_malloc0(sizeof(DumpGuestMemoryFormatList));
+ item = item->next;
+ item->value = DUMP_GUEST_MEMORY_FORMAT_KDUMP_SNAPPY;
+#endif
+
+ return cap;
+}