|
|
9ae3a8 |
From 725ecdf6e40eaebbfa8e5328a5ff96163b61637f 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:39:00 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 29/41] dump: do not dump non-existent guest memory
|
|
|
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-30-marcandre.lureau@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 78379
|
|
|
9ae3a8 |
O-Subject: [RHEL-7.5 qemu-kvm PATCH v3 29/41] dump: do not dump non-existent guest memory
|
|
|
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: Cornelia Huck <cohuck@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
It does not really make sense to dump memory that is not there.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Moreover, that fixes a segmentation fault when calling dump-guest-memory
|
|
|
9ae3a8 |
with no filter for a machine with no memory defined.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
New behaviour is:
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
(qemu) dump-guest-memory /dev/null
|
|
|
9ae3a8 |
dump: no guest memory to dump
|
|
|
9ae3a8 |
(qemu) dump-guest-memory /dev/null 0 4096
|
|
|
9ae3a8 |
dump: no guest memory to dump
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
|
|
|
9ae3a8 |
Tested-by: Laurent Vivier <lvivier@redhat.com>
|
|
|
9ae3a8 |
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
|
|
|
9ae3a8 |
Reviewed-by: Greg Kurz <groug@kaod.org>
|
|
|
9ae3a8 |
Reviewed-by: Peter Xu <peterx@redhat.com>
|
|
|
9ae3a8 |
Message-Id: <20170913142036.2469-4-lvivier@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
(cherry picked from commit d1e6994abcd12c7f54aa73ff848fb6215c783898)
|
|
|
9ae3a8 |
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
dump.c | 6 ++++++
|
|
|
9ae3a8 |
1 file changed, 6 insertions(+)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/dump.c b/dump.c
|
|
|
9ae3a8 |
index 008a722..d629c8d 100644
|
|
|
9ae3a8 |
--- a/dump.c
|
|
|
9ae3a8 |
+++ b/dump.c
|
|
|
9ae3a8 |
@@ -1536,6 +1536,12 @@ static void dump_init(DumpState *s, int fd, bool has_format,
|
|
|
9ae3a8 |
fprintf(stderr, "DUMP: total memory to dump: %lu\n", s->total_size);
|
|
|
9ae3a8 |
#endif
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
+ /* it does not make sense to dump non-existent memory */
|
|
|
9ae3a8 |
+ if (!s->total_size) {
|
|
|
9ae3a8 |
+ error_setg(errp, "dump: no guest memory to dump");
|
|
|
9ae3a8 |
+ goto cleanup;
|
|
|
9ae3a8 |
+ }
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
s->start = get_start_block(s);
|
|
|
9ae3a8 |
if (s->start == -1) {
|
|
|
9ae3a8 |
error_set(errp, QERR_INVALID_PARAMETER, "begin");
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.8.3.1
|
|
|
9ae3a8 |
|