|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v4 04/16] libs/guest: Use a single write_exact in write_headers
On Wed, Jun 03, 2026 at 02:05:51PM +0100, Frediano Ziglio wrote:
> From: Frediano Ziglio <frediano.ziglio@xxxxxxxxxx>
>
> Reduce number of syscalls.
... by coalescing the image and the domain headers into a single IO
vector array.
>
> Signed-off-by: Frediano Ziglio <frediano.ziglio@xxxxxxxxxx>
Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> --
> Changes since v2:
> - change prefix in subject.
> ---
> tools/libs/guest/xg_sr_save.c | 37 +++++++++++++++++------------------
> 1 file changed, 18 insertions(+), 19 deletions(-)
>
> diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
> index 62a39dfecc..8c4e760f8d 100644
> --- a/tools/libs/guest/xg_sr_save.c
> +++ b/tools/libs/guest/xg_sr_save.c
> @@ -10,17 +10,22 @@ static int write_headers(struct xc_sr_context *ctx,
> uint16_t guest_type)
> {
> xc_interface *xch = ctx->xch;
> int32_t xen_version = xc_version(xch, XENVER_version, NULL);
> - struct xc_sr_ihdr ihdr = {
> - .marker = IHDR_MARKER,
> - .id = htonl(IHDR_ID),
> - .version = htonl(3),
> - .options = htons(IHDR_OPT_LITTLE_ENDIAN),
> - };
> - struct xc_sr_dhdr dhdr = {
> - .type = guest_type,
> - .page_shift = XC_PAGE_SHIFT,
> - .xen_major = (xen_version >> 16) & 0xffff,
> - .xen_minor = (xen_version) & 0xffff,
> + struct {
> + struct xc_sr_ihdr ihdr;
> + struct xc_sr_dhdr dhdr;
> + } hdrs = {
> + {
> + .marker = IHDR_MARKER,
> + .id = htonl(IHDR_ID),
> + .version = htonl(3),
> + .options = htons(IHDR_OPT_LITTLE_ENDIAN),
> + },
> + {
> + .type = guest_type,
> + .page_shift = XC_PAGE_SHIFT,
> + .xen_major = (xen_version >> 16) & 0xffff,
You don't strictly need the mask here AFAICT?
Thanks, Roger.
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |