[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v8 2/4] libs/guest: move batch_pfns into a separate structure



On Sat, Jul 11, 2026 at 10:21:26PM +0100, Frediano Ziglio wrote:
> Prepare for following change.

The "following change" is likely going to be unrelated, as patches of a
series can be committed at different time. So you need to name the patch
for which this is a preparatory change. Something like:

    Preparation for a followup patch "libs/guest: allocate various
    migration arrays just once".

> diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
> index 84fdbe4140..e7c22e6500 100644
> --- a/tools/libs/guest/xg_sr_save.c
> +++ b/tools/libs/guest/xg_sr_save.c
> @@ -75,7 +75,7 @@ static int write_checkpoint_record(struct xc_sr_context 
> *ctx)
>  
>  /*
>   * Writes a batch of memory as a PAGE_DATA record into the stream.  The batch
> - * is constructed in ctx->save.batch_pfns.
> + * is constructed in ctx->save.buffers->batch_pfns.
>   *
>   * This function:
>   * - gets the types for each pfn in the batch.
> @@ -95,6 +95,7 @@ static int write_batch(struct xc_sr_context *ctx)
>      void *page, *orig_page;
>      uint64_t *rec_pfns = NULL;
>      struct iovec *iov = NULL; int iovcnt = 0;
> +    xen_pfn_t *const batch_pfns = ctx->save.buffers->batch_pfns;
>      struct {
>          struct xc_sr_rhdr rec;
>          struct xc_sr_rec_page_data_header page_data;
> @@ -110,6 +111,8 @@ static int write_batch(struct xc_sr_context *ctx)
>      };
>  
>      assert(nr_pfns != 0);
> +    assert(nr_pfns <= MAX_BATCH_SIZE);
> +    assert(ctx->save.buffers);

This second assert is a bit useless, we already used the pointer, so we
know it's valid.

With that removed, and the commit message adjusted, which could be done
while committing:
Reviewed-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>

Thanks,


--
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.