From: Janosch Frank <frankja@linux.ibm.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
"Bonzini, Paolo" <pbonzini@redhat.com>,
mhartmay@linux.ibm.com,
Christian Borntraeger <borntraeger@linux.ibm.com>,
imbrenda@linux.ibm.com, Halil Pasic <pasic@linux.ibm.com>,
Cornelia Huck <cohuck@redhat.com>, Thomas Huth <thuth@redhat.com>,
"open list:S390 SCLP-backed..." <qemu-s390x@nongnu.org>,
"Henderson, Richard" <richard.henderson@linaro.org>
Subject: Re: [PATCH v2 01/11] dump: Cleanup memblock usage
Date: Wed, 13 Jul 2022 17:30:05 +0200 [thread overview]
Message-ID: <fd62d8e8-a9f0-1e19-c8da-c8f31248983e@linux.ibm.com> (raw)
In-Reply-To: <CAMxuvaz=erLFMasq1CK_Y1Ku+dU0ZMR3EPF8ehDnPjQ94R9Rfw@mail.gmail.com>
On 7/13/22 17:09, Marc-André Lureau wrote:
> Hi
>
> On Wed, Jul 13, 2022 at 5:07 PM Janosch Frank <frankja@linux.ibm.com> wrote:
>>
>> The iteration over the memblocks is hard to understand so it's about
>> time to clean it up.
>>
>> struct DumpState's next_block and start members can and should be
>> local variables within the iterator.
>>
>> Instead of manually grabbing the next memblock we can use
>> QTAILQ_FOREACH to iterate over all memblocks.
>>
>> The begin and length fields in the DumpState have been left untouched
>> since the qmp arguments share their names.
>>
>> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
>
> After this patch:
> ./qemu-system-x86_64 -monitor stdio -S
> (qemu) dump-guest-memory foo
> Error: dump: failed to save memory: Bad address
If you have more ways to check for dump errors then please send them to
me. I'm aware that this might not have been a 100% conversion and I'm a
bit terrified about the fact that this will affect all architectures.
Anyway, I'll have a look.
[...]
>> +static inline int64_t dump_get_memblock_start(GuestPhysBlock *block, int64_t filter_area_start,
>> + int64_t filter_area_length)
>> +{
>> + if (filter_area_length) {
>> + /*
>> + * Check if block is within guest memory dump area. If not
>> + * go to next one.
>> + */
>
> Or rather "return -1 if the block is not within filter area"
Sure
>
>> + if (block->target_start >= filter_area_start + filter_area_length ||
>> + block->target_end <= filter_area_start) {
>> + return -1;
>> + }
>> + if (filter_area_start > block->target_start) {
>> + return filter_area_start - block->target_start;
>> + }
>> + }
>> + return block->target_start;
>
> This used to be 0. Changing that, I think the patch looks good.
> Although it could perhaps be splitted to introduce the two functions.
Yes but the 0 was used to indicate that we would have needed continue
iterating and the iteration is done via other means in this patch.
Or am I missing something?
>
>> +}
>> #endif
>> --
>> 2.34.1
>>
>
>
next prev parent reply other threads:[~2022-07-13 15:32 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-13 13:03 [PATCH v2 00/11] dump: Add arch section and s390x PV dump Janosch Frank
2022-07-13 13:03 ` [PATCH v2 01/11] dump: Cleanup memblock usage Janosch Frank
2022-07-13 15:09 ` Marc-André Lureau
2022-07-13 15:30 ` Janosch Frank [this message]
2022-07-13 15:35 ` Marc-André Lureau
2022-07-14 9:40 ` Janosch Frank
2022-07-15 8:34 ` Marc-André Lureau
2022-07-13 13:03 ` [PATCH v2 02/11] dump: Allocate header Janosch Frank
2022-07-13 15:20 ` Marc-André Lureau
2022-07-13 13:03 ` [PATCH v2 03/11] dump: Split write of section headers and data and add a prepare step Janosch Frank
2022-07-13 15:31 ` Marc-André Lureau
2022-07-14 11:45 ` Janosch Frank
2022-07-13 13:03 ` [PATCH v2 04/11] dump: Reorder struct DumpState Janosch Frank
2022-07-13 15:46 ` Marc-André Lureau
2022-07-13 13:03 ` [PATCH v2 05/11] dump/dump: Add section string table support Janosch Frank
2022-07-13 15:58 ` Marc-André Lureau
2022-07-14 11:53 ` Janosch Frank
2022-07-14 11:55 ` Marc-André Lureau
2022-07-13 13:03 ` [PATCH v2 06/11] dump/dump: Add arch section support Janosch Frank
2022-07-13 16:02 ` Marc-André Lureau
2022-07-13 13:03 ` [PATCH v2 07/11] linux header sync Janosch Frank
2022-07-13 16:03 ` Marc-André Lureau
2022-07-13 13:03 ` [PATCH v2 08/11] s390x: Add protected dump cap Janosch Frank
2022-07-13 13:03 ` [PATCH v2 09/11] s390x: Introduce PV query interface Janosch Frank
2022-07-15 8:10 ` Marc-André Lureau
2022-07-15 8:18 ` Janosch Frank
2022-07-15 8:23 ` Marc-André Lureau
2022-07-13 13:03 ` [PATCH v2 10/11] s390x: Add KVM PV dump interface Janosch Frank
2022-07-13 13:03 ` [PATCH v2 11/11] s390x: pv: Add dump support Janosch Frank
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=fd62d8e8-a9f0-1e19-c8da-c8f31248983e@linux.ibm.com \
--to=frankja@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=cohuck@redhat.com \
--cc=imbrenda@linux.ibm.com \
--cc=marcandre.lureau@redhat.com \
--cc=mhartmay@linux.ibm.com \
--cc=pasic@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.