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

Re: [PATCH v4 01/16] libs/guest: Reduce number of parts in write_split_record


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Frediano Ziglio <freddy77@xxxxxxxxx>
  • Date: Tue, 9 Jun 2026 09:32:22 +0100
  • Arc-authentication-results: i=1; mx.google.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=o1JZ9V+W/Tg7UFfDkMU10i7KhRb7QTXq3UPfKhvnuPw=; fh=bz012bFXXMSWKBVgaOsf9BhRnV5smxYP7I+E9Nd6XyE=; b=jZImJ4RKxAsDzYewkiXQ0Dkys8wKZW7aNHmgy+W2nLr457TLwNtoGX4Qi3f7KjHmpN OUgrNIdTBKm/fCQn9r2BFVl/yUtUJzqDMN3T486c2bTmUwr2Oz+9dXwgaY5a33kRkVpv Vu+TmkRTnbzczWw8zGKTue+GcqcGLYVY5vXraq1OzGZ5oxQ0HqD9trmS01LHuCRMYwOy anwPFNIW8Peto5UtgREvqbtwdUF19vuAFTJkrmDRQgnYDAN5W0Xjifzg315BCjz7sqAF OHeARzpubOS9R+1BzYZL/OrIEb3OTrs3HGP0MfyjEk08vVrWfAepjwOH4gj8IlZ8cCSK fhPQ==; darn=lists.xenproject.org
  • Arc-seal: i=1; a=rsa-sha256; t=1780993953; cv=none; d=google.com; s=arc-20240605; b=luDwlafdCOieFXcDNQ6ydq/whRyFp0wbSWuQl3lf4YHZ7Lc10Og4Pz+fp53Gv5g5LT hVYVvZzyBPIbbpMvHvn3Ed1MuQanTSQo0XJ8fFXOcamqpFxV5AT7kEAm/K+EbhlUPdOv U2c9e8n2OSh93npYUJ25v3yAV8FIiasYrha7n5A8TZiGvY3PksZ2w07JBnD7UcCtG1Ow 2mrx3r20wFj039xS7qeMZfuVolPRIF3M6l+6DjqsoaGhwm0JmW70qAAT05MlohA6B/P8 Bf8k+MPPN9ybPaXEKwiPaB4+ZKSyCuHGwvoIh8FxXbgIeoxd2bgRd2GP75B9rdtWPyGH TG4g==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Frediano Ziglio <frediano.ziglio@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Tue, 09 Jun 2026 08:32:55 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, 8 Jun 2026 at 15:23, Roger Pau Monné <roger.pau@xxxxxxxxxx> wrote:
>
> On Wed, Jun 03, 2026 at 02:05:48PM +0100, Frediano Ziglio wrote:
> > From: Frediano Ziglio <frediano.ziglio@xxxxxxxxxx>
> >
> > Small optimization.
> > There's no much sense to split the header in 2 pieces, it will
> > just take more time and space to reassemble them in the final
> > buffer.
> > This also avoids truncating combined_length to 32 bit in case of
> > 64 bit machines potentially avoiding following record_length check
>
> I'm not sure I understand the sentence above: rec->length is a fixed
> width type uint32_t, and hence it will always be 32bit, regardless of
> whether it's build in 32 or 64 bit modes.
>
> I do get the truncation part, and that using size_t is indeed better.
>

I improved the commit message as

This also avoids truncating combined_length to 32 bit in case of
64 bit machines potentially avoiding following record_length check
(it could still be truncated writing it in xc_sr_rhdr structure
but the following check will catch it).

> > (it could still be truncated writing it in xc_sr_rhdr structure
> > but the following check will catch it).
> > The function become more coherent with following read_record
> > function.
> >
> > Signed-off-by: Frediano Ziglio <frediano.ziglio@xxxxxxxxxx>
>
> Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
>
> With the commit message possibly clarified.
>
> Thanks, Roger.

Frediano



 


Rackspace

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