From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: marcandre.lureau@redhat.com
Subject: [PATCH 5/5] dump: Drop redundant check for empty dump
Date: Mon, 30 Oct 2023 14:37:12 +0100 [thread overview]
Message-ID: <20231030133712.2822276-6-armbru@redhat.com> (raw)
In-Reply-To: <20231030133712.2822276-1-armbru@redhat.com>
dump_init() first computes the size of the dump, taking the filter
area into account, and fails if its zero. It then looks for memory in
the filter area, and fails if there is none.
This is redundant: if the size of the dump is zero, there is no
memory, and vice versa. Delete this check.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
dump/dump.c | 26 --------------------------
1 file changed, 26 deletions(-)
diff --git a/dump/dump.c b/dump/dump.c
index d888e4bd3c..03627a4c17 100644
--- a/dump/dump.c
+++ b/dump/dump.c
@@ -1674,26 +1674,6 @@ static void create_kdump_vmcore(DumpState *s, Error **errp)
}
}
-static int validate_start_block(DumpState *s)
-{
- GuestPhysBlock *block;
-
- if (!dump_has_filter(s)) {
- return 0;
- }
-
- QTAILQ_FOREACH(block, &s->guest_phys_blocks.head, next) {
- /* This block is out of the range */
- if (block->target_start >= s->filter_area_begin + s->filter_area_length ||
- block->target_end <= s->filter_area_begin) {
- continue;
- }
- return 0;
- }
-
- return -1;
-}
-
static void get_max_mapnr(DumpState *s)
{
GuestPhysBlock *last_block;
@@ -1842,12 +1822,6 @@ static void dump_init(DumpState *s, int fd, bool has_format,
goto cleanup;
}
- /* Is the filter filtering everything? */
- if (validate_start_block(s) == -1) {
- error_setg(errp, QERR_INVALID_PARAMETER, "begin");
- goto cleanup;
- }
-
/* get dump info: endian, class and architecture.
* If the target architecture is not supported, cpu_get_dump_info() will
* return -1.
--
2.41.0
next prev parent reply other threads:[~2023-10-30 13:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-30 13:37 [PATCH 0/5] dump: Minor fixes & improvements Markus Armbruster
2023-10-30 13:37 ` [PATCH 1/5] dump: Rename qmp_dump_guest_memory() parameter to match QAPI schema Markus Armbruster
2023-10-31 6:54 ` Marc-André Lureau
2023-10-30 13:37 ` [PATCH 2/5] dump: Fix g_array_unref(NULL) in dump-guest-memory Markus Armbruster
2023-10-31 6:53 ` Marc-André Lureau
2023-10-31 9:02 ` Markus Armbruster
2023-10-31 9:06 ` Markus Armbruster
2023-10-31 10:09 ` Marc-André Lureau
2023-10-30 13:37 ` [PATCH 3/5] dump: Recognize "fd:" protocols on Windows hosts Markus Armbruster
2023-10-31 6:55 ` Marc-André Lureau
2023-10-30 13:37 ` [PATCH 4/5] dump: Improve some dump-guest-memory error messages Markus Armbruster
2023-10-30 14:05 ` Philippe Mathieu-Daudé
2023-10-31 5:44 ` Markus Armbruster
2023-10-30 13:37 ` Markus Armbruster [this message]
2023-10-31 10:23 ` [PATCH 5/5] dump: Drop redundant check for empty dump Marc-André Lureau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231030133712.2822276-6-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).