[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: Frediano Ziglio <freddy77@xxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Mon, 8 Jun 2026 16:22:52 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Gf9FbH3sawEqfVJhCcjgRsUN7h1KXfkMtsmcB52mMs4=; b=Ma1QH0Rv3KXMiIg4YqUz4aXwd8S8jscK1DoMSim+MMXQmxg23fHxEAvon7qJGDvJTBhe5lFuNvNHENRgdRflEGmpt+1H5oE+2o9nbDz4CPzjV+zN9+Z76bZbnQZvooms60P0aQDaNV8VViZXS4WBGPy0ZJClTEMKgjmEJ0ZcInT+USOFsEgau8ps4AXsb5GlR1+cULP/Tv8bWWG/oBfqdTaAnm+ZC33lezu2hqz7lKUehmcb85V3E1l1g1JZ3Z4FZNUu136pLgzBrXmKu+9ytoWetE95LvMAMZ+buLYPNGOt/tX2QfHFXHBqBvRR/z/a9C1M5DRnhbcK9KCJYTYBQg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gRg2BaerpBxbfktoj+aFqs0XobiMIi/HqcS6cxlq5vrkTUlFsuatPp+waFEmr+mAgwa90FLPOvVF2W8cLPfxXNKPtPUBuobxpO+nUjpna9inTtU3TYcl21AmZcMx8Qh3fBF8KnL9po8LL96mO4hi6KT+xJeIQSwPujPHevwtFEIKq6ylx4jEUWtcyRTR1KcWg62HKHJ4ZkFJ/wHBC+5JxAqCTFAsEPAGy2JhHqlWad35VdDd53yrx7MTbhpIp3ob0lFa+ak9YvqrIPv9k4Y+e5wV6ss+RUxqCxPi5nycj+jauhD6J+7FzttDWEg2I1iQHiQBKQY5+VKKXGxDnknQ7g==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • 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: Mon, 08 Jun 2026 14:23:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

> (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.



 


Rackspace

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