All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: no-reply@sashiko.virtuozzo.com
To: Alexander Ivanov <alexander.ivanov@virtuozzo.com>,
	 andrey.zhadchenko@virtuozzo.com
Cc: andrey.drobyshev@virtuozzo.com, svt-core@virtuozzo.com
Subject: Re: [PATCH hci-8.2 v3 1/5] linux-headers: add the vhost-blk held request ioctls #VSTOR-152175
Date: Tue, 1 Dec 2026 00:53:19 +0000	[thread overview]
Message-ID: <010701a22f178185-4fc78430-d11a-406e-8b7e-3b88d0124193-000000@eu-central-1.amazonses.com> (raw)
In-Reply-To: <20261130094210.1686802-2-alexander.ivanov@virtuozzo.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] linux-headers: ambiguous 'reserved must be 0' in held-request
  ioctl docs
--

commit 611e7f67446f06e405b70a31daff650440389848
Author: Alexander Ivanov <alexander.ivanov@virtuozzo.com>

linux-headers: add the vhost-blk held request ioctls #VSTOR-152175

This adds the UAPI for holding vhost-blk requests that fail with ENOSPC. It defines the error policy flags, the held request structures and the four ioctls VHOST_BLK_SET_ERROR_POLICY, VHOST_BLK_SET_ERROR_FD, VHOST_BLK_GET_HELD_REQS and VHOST_BLK_RESUBMIT.

> diff --git a/include/standard-headers/linux/vhost_types.h b/include/standard-headers/linux/vhost_types.h
> --- a/include/standard-headers/linux/vhost_types.h
> +++ b/include/standard-headers/linux/vhost_types.h

[ ... ]

> +struct vhost_blk_held_req {
> +	uint16_t vq;
> +	uint16_t head;
> +	int32_t error;		/* positive errno */
> +	uint32_t type;		/* VIRTIO_BLK_T_* */
> +	uint32_t reserved;
> +};
> +
> +struct vhost_blk_held_reqs {
> +	uint32_t nr;
> +	uint32_t reserved;
> +	struct vhost_blk_held_req reqs[];
> +};
> diff --git a/linux-headers/linux/vhost.h b/linux-headers/linux/vhost.h
> --- a/linux-headers/linux/vhost.h
> +++ b/linux-headers/linux/vhost.h

[ ... ]

> +/*
> + * Resubmit requests by vq and head, as if they were just taken from the avail
> + * ring. Only heads read with VHOST_BLK_GET_HELD_REQS after the last stop may be
> + * passed: the kernel does not track them, and a head passed again after its
> + * request completed, or still owned by the guest, is completed twice. A head
> + * still in flight fails with -EBUSY. error and type are ignored, reserved
> + * must be 0. On error, nr is set to the number of requests resubmitted.
> + */
> +#define VHOST_BLK_RESUBMIT		_IOWR(VHOST_VIRTIO, 0xFA, \
> +					      struct vhost_blk_held_reqs)

[Severity: Low]
This isn't a bug, but is "reserved must be 0" clear enough here and in the VHOST_BLK_GET_HELD_REQS comment? Both struct vhost_blk_held_reqs and struct vhost_blk_held_req have a field named reserved. The comments do not say whether only the outer field, or also the reserved field of every element in reqs[], must be zero on input.

The VHOST_BLK_RESUBMIT comment also says error and type are ignored, but never says that vq and head are the fields read from each element. It does not say that nr is the number of entries to resubmit, whereas for GET it is the capacity of reqs[]. Since this header is the only ABI specification, could these be spelled out?

Carry the trailer below into the next revision and Sashiko will not review this patch again.

Reviewed-by: Sashiko <no-reply@sashiko.virtuozzo.com>

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261130094210.1686802-1-alexander.ivanov@virtuozzo.com?part=1

  reply	other threads:[~2026-12-01  0:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30  9:42 [PATCH hci-8.2 v3 0/5] vhost-blk: support the werror/rerror policies Alexander Ivanov
2026-11-30  9:42 ` [PATCH hci-8.2 v3 1/5] linux-headers: add the vhost-blk held request ioctls #VSTOR-152175 Alexander Ivanov
2026-12-01  0:53   ` no-reply [this message]
2026-12-01  9:03     ` Alexander Ivanov
2026-11-30  9:42 ` [PATCH hci-8.2 v3 2/5] vhost-blk: add the werror and rerror properties #VSTOR-152175 Alexander Ivanov
2026-12-01  0:54   ` no-reply
2026-11-30  9:42 ` [PATCH hci-8.2 v3 3/5] vhost-blk: stop vhost on every VM stop #VSTOR-152175 Alexander Ivanov
2026-12-01  0:58   ` no-reply
2026-12-01  9:07     ` Alexander Ivanov
2026-11-30  9:42 ` [PATCH hci-8.2 v3 4/5] vhost-blk: pause the VM on a request failed with ENOSPC #VSTOR-152175 Alexander Ivanov
2026-12-01  1:07   ` no-reply
2026-12-01  9:14     ` Alexander Ivanov
2026-11-30  9:42 ` [PATCH hci-8.2 v3 5/5] vhost-blk: migrate the held requests #VSTOR-152175 Alexander Ivanov
2026-12-01  1:10   ` no-reply

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=010701a22f178185-4fc78430-d11a-406e-8b7e-3b88d0124193-000000@eu-central-1.amazonses.com \
    --to=no-reply@sashiko.virtuozzo.com \
    --cc=alexander.ivanov@virtuozzo.com \
    --cc=andrey.drobyshev@virtuozzo.com \
    --cc=andrey.zhadchenko@virtuozzo.com \
    --cc=svt-core@virtuozzo.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.