public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>
Cc: passt-dev@passt.top
Subject: Re: [PATCH 3/9] vhost-user: add VHOST_USER_SET_LOG_FD command
Date: Fri, 17 Jan 2025 19:04:55 +0100	[thread overview]
Message-ID: <20250117190455.185a657b@elisabeth> (raw)
In-Reply-To: <20241219111400.2352110-4-lvivier@redhat.com>

On Thu, 19 Dec 2024 12:13:54 +0100
Laurent Vivier <lvivier@redhat.com> wrote:

> VHOST_USER_SET_LOG_FD is an optional message with an eventfd
> in ancillary data, it may be used to inform the front-end that the
> log has been modified.
> 
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
>  vhost_user.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  vhost_user.h |  1 +
>  virtio.h     |  2 ++
>  3 files changed, 59 insertions(+)
> 
> diff --git a/vhost_user.c b/vhost_user.c
> index 48226a8b7686..ce4373d9eeca 100644
> --- a/vhost_user.c
> +++ b/vhost_user.c
> @@ -504,6 +504,57 @@ static bool vu_set_mem_table_exec(struct vu_dev *vdev,
>  	return false;
>  }
>  
> +/**
> + * vu_close_log() - Close the logging file descriptor
> + * @vdev:	vhost-user device
> + */
> +static void vu_close_log(struct vu_dev *vdev)
> +{
> +	if (vdev->log_call_fd != -1) {
> +		close(vdev->log_call_fd);
> +		vdev->log_call_fd = -1;
> +	}
> +}
> +
> +/**
> + * vu_log_kick() - Inform the front-end that the log has been modified
> + * @vdev:	vhost-user device
> + */
> +/* cppcheck-suppress unusedFunction */
> +void vu_log_kick(const struct vu_dev *vdev)
> +{
> +	if (vdev->log_call_fd != -1) {
> +		int rc;
> +
> +		rc = eventfd_write(vdev->log_call_fd, 1);
> +		if (rc == -1)
> +			die_perror("vhost-user kick eventfd_write()");
> +	}
> +}
> +
> +/**
> + * vu_set_log_fd_exec() -- Set the eventfd used to report logging update

Nit: single '-' between function name and comment.

-- 
Stefano


  reply	other threads:[~2025-01-17 18:05 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-19 11:13 [PATCH 0/9] vhost-user: Migration support Laurent Vivier
2024-12-19 11:13 ` [PATCH 1/9] virtio: Use const pointer for vu_dev Laurent Vivier
2024-12-20  0:24   ` David Gibson
2025-01-06  8:58     ` Stefano Brivio
2024-12-19 11:13 ` [PATCH 2/9] vhost-user: update protocol features and commands list Laurent Vivier
2025-01-17 18:04   ` Stefano Brivio
2024-12-19 11:13 ` [PATCH 3/9] vhost-user: add VHOST_USER_SET_LOG_FD command Laurent Vivier
2025-01-17 18:04   ` Stefano Brivio [this message]
2024-12-19 11:13 ` [PATCH 4/9] vhost-user: Pass vu_dev to more virtio functions Laurent Vivier
2024-12-19 11:13 ` [PATCH 5/9] vhost-user: add VHOST_USER_SET_LOG_BASE command Laurent Vivier
2025-01-17 18:05   ` Stefano Brivio
2025-01-20 10:57     ` Laurent Vivier
2025-01-17 19:10   ` Stefano Brivio
2024-12-19 11:13 ` [PATCH 6/9] vhost-user: Report to front-end we support VHOST_USER_PROTOCOL_F_LOG_SHMFD Laurent Vivier
2024-12-19 11:13 ` [PATCH 7/9] vhost-user: add VHOST_USER_CHECK_DEVICE_STATE command Laurent Vivier
2024-12-19 11:13 ` [PATCH 8/9] vhost-user: add VHOST_USER_SET_DEVICE_STATE_FD command Laurent Vivier
2024-12-19 19:47   ` Stefano Brivio
2024-12-20  7:56     ` Laurent Vivier
2024-12-20 13:28       ` Stefano Brivio
2025-01-17 18:05   ` Stefano Brivio
2025-01-20 11:00     ` Laurent Vivier
2025-01-20 20:09       ` Stefano Brivio
2024-12-19 11:14 ` [PATCH 9/9] vhost-user: Report to front-end we support VHOST_USER_PROTOCOL_F_DEVICE_STATE Laurent Vivier
2025-01-17 12:13 ` [PATCH 0/9] vhost-user: Migration support Laurent Vivier
2025-01-17 12:44   ` Stefano Brivio
2025-01-17 13:27     ` Laurent Vivier
2025-01-17 13:38       ` Stefano Brivio
2025-01-17 13:58         ` Laurent Vivier
2025-01-17 14:29           ` Stefano Brivio
2025-01-17 13:31     ` Stefano Brivio
2025-01-17 16:51 ` Stefano Brivio

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=20250117190455.185a657b@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=passt-dev@passt.top \
    /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.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).