dump: Rework filter area variables

While the DumpState begin and length variables directly mirror the API
variable names they are not very descriptive. So let's add a
"filter_area_" prefix and make has_filter a function checking length > 0.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220811121111.9878-6-frankja@linux.ibm.com>
This commit is contained in:
Janosch Frank 2022-08-11 12:10:58 +00:00 committed by Marc-André Lureau
parent 0c2994ac90
commit dddf725f70
2 changed files with 41 additions and 25 deletions

View file

@ -166,9 +166,16 @@ typedef struct DumpState {
hwaddr memory_offset;
int fd;
bool has_filter;
int64_t begin;
int64_t length;
/*
* Dump filter area variables
*
* A filtered dump only contains the guest memory designated by
* the start address and length variables defined below.
*
* If length is 0, no filtering is applied.
*/
int64_t filter_area_begin; /* Start address of partial guest memory area */
int64_t filter_area_length; /* Length of partial guest memory area */
uint8_t *note_buf; /* buffer for notes */
size_t note_buf_offset; /* the writing place in note_buf */