diff options
author | Markus Armbruster <armbru@redhat.com> | 2023-10-31 11:45:31 +0100 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2023-11-02 18:40:50 +0400 |
commit | 4023839757b2c01e0350ce92902c6f74dce7d011 (patch) | |
tree | 1d4b9895f75d1d4aad5b28e57d9d8b9f0d38e252 /dump | |
parent | 28035bed1c565eace7db18971a7e960a8d1f7c44 (diff) |
dump: Drop redundant check for empty dump
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>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20231031104531.3169721-6-armbru@redhat.com>
Diffstat (limited to 'dump')
-rw-r--r-- | dump/dump.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/dump/dump.c b/dump/dump.c index ec2cfcf9f7..1c304cadfd 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -1688,26 +1688,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; @@ -1857,12 +1837,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. |