[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 3/7] dump: do not dump non-existent guest memory
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PULL 3/7] dump: do not dump non-existent guest memory |
Date: |
Thu, 14 Sep 2017 16:04:43 +0100 |
From: Cornelia Huck <address@hidden>
It does not really make sense to dump memory that is not there.
Moreover, that fixes a segmentation fault when calling dump-guest-memory
with no filter for a machine with no memory defined.
New behaviour is:
(qemu) dump-guest-memory /dev/null
dump: no guest memory to dump
(qemu) dump-guest-memory /dev/null 0 4096
dump: no guest memory to dump
Signed-off-by: Cornelia Huck <address@hidden>
Tested-by: Laurent Vivier <address@hidden>
Reviewed-by: Laurent Vivier <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Reviewed-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Laurent Vivier <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
---
dump.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/dump.c b/dump.c
index a79773d0f7..d2093e141b 100644
--- a/dump.c
+++ b/dump.c
@@ -1536,6 +1536,12 @@ static void dump_init(DumpState *s, int fd, bool
has_format,
fprintf(stderr, "DUMP: total memory to dump: %lu\n", s->total_size);
#endif
+ /* it does not make sense to dump non-existent memory */
+ if (!s->total_size) {
+ error_setg(errp, "dump: no guest memory to dump");
+ goto cleanup;
+ }
+
s->start = get_start_block(s);
if (s->start == -1) {
error_setg(errp, QERR_INVALID_PARAMETER, "begin");
--
2.13.5
- [Qemu-devel] [PULL 0/7] hmp queue, Dr. David Alan Gilbert (git), 2017/09/14
- [Qemu-devel] [PULL 2/7] hmp: fix "dump-quest-memory" segfault (arm), Dr. David Alan Gilbert (git), 2017/09/14
- [Qemu-devel] [PULL 1/7] hmp: fix "dump-quest-memory" segfault (ppc), Dr. David Alan Gilbert (git), 2017/09/14
- [Qemu-devel] [PULL 3/7] dump: do not dump non-existent guest memory,
Dr. David Alan Gilbert (git) <=
- [Qemu-devel] [PULL 4/7] tests/hmp: test "none" machine with memory, Dr. David Alan Gilbert (git), 2017/09/14
- [Qemu-devel] [PULL 5/7] hmp: extend "info numa" with hotplugged memory information, Dr. David Alan Gilbert (git), 2017/09/14
- [Qemu-devel] [PULL 7/7] hmp: introduce 'info memory_size_summary' command, Dr. David Alan Gilbert (git), 2017/09/14
- [Qemu-devel] [PULL 6/7] qmp: introduce query-memory-size-summary command, Dr. David Alan Gilbert (git), 2017/09/14
- Re: [Qemu-devel] [PULL 0/7] hmp queue, Peter Maydell, 2017/09/14