From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=KwLiMADH; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id 412E75A061D for ; Fri, 17 Jan 2025 19:05:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1737137104; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bwyrtTaTox9wM4EIPkiLNWX+5oMh1ZZaStAFJ8eLBJU=; b=KwLiMADHvsHtLbPHInKCgk2DoFkndfy7roVGkA3ENm1cCfgpkq/50SmZitJ40AcJNC75vd F7f2D0Hjlrm/NueDaNrjL6BhXoZzz2sjyxqUnejkgwtbj57MuRZ38HKvgfa83/8K3N68+d cLrBoA6REzDykKnQUF1ks3LQc1P0Vq8= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-19-sJ4IXh1FM_yj9ybSCru_Vg-1; Fri, 17 Jan 2025 13:05:01 -0500 X-MC-Unique: sJ4IXh1FM_yj9ybSCru_Vg-1 X-Mimecast-MFC-AGG-ID: sJ4IXh1FM_yj9ybSCru_Vg Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-43628594d34so12592515e9.2 for ; Fri, 17 Jan 2025 10:05:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737137098; x=1737741898; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=bwyrtTaTox9wM4EIPkiLNWX+5oMh1ZZaStAFJ8eLBJU=; b=UL/ZU1GMwsZy9fcfOdqba74irXcVFom8/ZQt3ggkuFBkviUtcY1K2ST2aJC5EVrVsN 4SfmEGfO8QIRhSvlqJ/Y/DDPwVzTIrB2xaXG1AyVinSkBcIN8vl5qnhBg2ypPNv7TXpD 495eGeskFXhdXAV7Sz9Nze6gwPOxnscqBiq2dhfKP6srro6tdYTaOGsj7U6skdFl82im n/Ww4ssSSCwUHvnHxGrAF/+qOUXE5r61W5ykE1l09uKsCzqykW7/dgfd5KlKArTFG8sN HzIhCyuceagKTkCOwdTnn47HgvEk1KpnykXuoN6n7pFjSDh2mtmLIsetZvEuiVUgH6J3 E3AQ== X-Gm-Message-State: AOJu0YxFXPLd9RhNJnonCNLyFTDYsQr5B64Uzx9HC4OwVrixDXbNufl2 qmaKEcFWJ36xtc54bCV3VMnvHEakr0jY1w/3YbMdJ8ut90rCQsB296CfwdcHDEb8tbuhVzN3D5k 63SfTFYxTOjPQBMwNsKgiuaVfLu6CVFK5/5PSRWbTuPg38YIR5eqIr5u1u6xGzkVqYsDhEZ+L1q CbyDvnKyn1/KOcKUkCvcv38qmnNtkSZxg9 X-Gm-Gg: ASbGnctYlNekmCdkAzozQq/Zr5j/LWzgQ5F+7ee9VH06D3mm7AHkZHwtWwA0kEdEdgS K6t45oZGGTAqxZCtNV+fzAMRrU6zDEvPO/3vuUSxodpKn02iJ8b2K+ch9tTLoOoYDHEqcggvcxu kZ8Ft0ioqacEgn7QdnBA6hLfTWbDh88hunlVINg5Z28YqQa/8b98DzCoxANVFiO0vruMEF4qmK4 E26qVhn6g5ogalNkjCGgo8VL/NITEhtwda1/+V3MYm2tJgXzJpWRZ2jrAZD9PvGgJI4 X-Received: by 2002:a05:600c:4e0b:b0:434:a525:7257 with SMTP id 5b1f17b1804b1-43891433febmr32347385e9.21.1737137098462; Fri, 17 Jan 2025 10:04:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IHEBKpHWQvjs5bwXIjRBDFqjje4cacCqEzWXW4/MEMEZBoWWFG/7QIVpjgsIaluFTqXzuc7bg== X-Received: by 2002:a05:600c:4e0b:b0:434:a525:7257 with SMTP id 5b1f17b1804b1-43891433febmr32346945e9.21.1737137097994; Fri, 17 Jan 2025 10:04:57 -0800 (PST) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38bf3275556sm3129145f8f.72.2025.01.17.10.04.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:04:56 -0800 (PST) Date: Fri, 17 Jan 2025 19:04:55 +0100 From: Stefano Brivio To: Laurent Vivier Subject: Re: [PATCH 3/9] vhost-user: add VHOST_USER_SET_LOG_FD command Message-ID: <20250117190455.185a657b@elisabeth> In-Reply-To: <20241219111400.2352110-4-lvivier@redhat.com> References: <20241219111400.2352110-1-lvivier@redhat.com> <20241219111400.2352110-4-lvivier@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: LSj_HxHGOvcnZOyFlej2HzFAygdBnoNB7OsexrLU84M_1737137100 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: OUDLPWIQQAT2MQ7SV5WHMAEBCLE6BTJ7 X-Message-ID-Hash: OUDLPWIQQAT2MQ7SV5WHMAEBCLE6BTJ7 X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Thu, 19 Dec 2024 12:13:54 +0100 Laurent Vivier 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 > --- > 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