All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] docs: Update vhost-user spec regarding backend program conventions
@ 2020-02-24 18:24 Sebastien Boeuf
  2020-03-06 12:34 ` Stefan Hajnoczi
  0 siblings, 1 reply; 5+ messages in thread
From: Sebastien Boeuf @ 2020-02-24 18:24 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, sebastien.boeuf, berrange, stefanha, mst

The vhost-user specification is not clearly stating the expected
behavior from a backend program whenever the client disconnects.

This patch addresses the issue by defining the default behavior and
proposing an alternative through a command line option.

By default, a backend program will terminate whenever the client
disconnects, unless told otherwise through the newly introduced
option --keep-listening.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 docs/interop/vhost-user.rst | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst
index 5f8b3a456b..078f8e2e57 100644
--- a/docs/interop/vhost-user.rst
+++ b/docs/interop/vhost-user.rst
@@ -1323,6 +1323,10 @@ The backend program must end (as quickly and cleanly as possible) when
 the SIGTERM signal is received. Eventually, it may receive SIGKILL by
 the management layer after a few seconds.
 
+By default, the backend program terminates after the client disconnects.
+This is useful to keep the backend program's lifetime synchronized with
+its client process.
+
 The following command line options have an expected behaviour. They
 are mandatory, unless explicitly said differently:
 
@@ -1337,6 +1341,14 @@ are mandatory, unless explicitly said differently:
   vhost-user socket as file descriptor FDNUM. It is incompatible with
   --socket-path.
 
+--keep-listening
+
+  When this option is provided, the backend program must keep listening
+  after the client disconnects. It accepts only 1 connection at a time
+  on each UNIX domain socket. This prevents the management layer from
+  having to spawn a new backend program each and every time the client
+  disconnects.
+
 --print-capabilities
 
   Output to stdout the backend capabilities in JSON format, and then
-- 
2.20.1

---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] docs: Update vhost-user spec regarding backend program conventions
  2020-02-24 18:24 [PATCH v2] docs: Update vhost-user spec regarding backend program conventions Sebastien Boeuf
@ 2020-03-06 12:34 ` Stefan Hajnoczi
  2020-03-06 12:52   ` Marc-André Lureau
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Hajnoczi @ 2020-03-06 12:34 UTC (permalink / raw)
  To: Sebastien Boeuf; +Cc: marcandre.lureau, berrange, qemu-devel, stefanha, mst

[-- Attachment #1: Type: text/plain, Size: 888 bytes --]

On Mon, Feb 24, 2020 at 07:24:54PM +0100, Sebastien Boeuf wrote:
> The vhost-user specification is not clearly stating the expected
> behavior from a backend program whenever the client disconnects.
> 
> This patch addresses the issue by defining the default behavior and
> proposing an alternative through a command line option.
> 
> By default, a backend program will terminate whenever the client
> disconnects, unless told otherwise through the newly introduced
> option --keep-listening.
> 
> Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  docs/interop/vhost-user.rst | 12 ++++++++++++
>  1 file changed, 12 insertions(+)

Perhaps --keep-listening should be optional?

If the maintainers are happy with the patch as is then so am I:

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] docs: Update vhost-user spec regarding backend program conventions
  2020-03-06 12:34 ` Stefan Hajnoczi
@ 2020-03-06 12:52   ` Marc-André Lureau
  2020-03-11 14:19     ` Boeuf, Sebastien
  0 siblings, 1 reply; 5+ messages in thread
From: Marc-André Lureau @ 2020-03-06 12:52 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: Sebastien Boeuf, Daniel P. Berrange, QEMU, Stefan Hajnoczi,
	Michael S. Tsirkin

Hi

On Fri, Mar 6, 2020 at 1:35 PM Stefan Hajnoczi <stefanha@gmail.com> wrote:
>
> On Mon, Feb 24, 2020 at 07:24:54PM +0100, Sebastien Boeuf wrote:
> > The vhost-user specification is not clearly stating the expected
> > behavior from a backend program whenever the client disconnects.
> >
> > This patch addresses the issue by defining the default behavior and
> > proposing an alternative through a command line option.
> >
> > By default, a backend program will terminate whenever the client
> > disconnects, unless told otherwise through the newly introduced
> > option --keep-listening.
> >
> > Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> > ---
> >  docs/interop/vhost-user.rst | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
>
> Perhaps --keep-listening should be optional?

I think it should be optional, and flagged by a capability.

>
> If the maintainers are happy with the patch as is then so am I:
>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>



-- 
Marc-André Lureau


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] docs: Update vhost-user spec regarding backend program conventions
  2020-03-06 12:52   ` Marc-André Lureau
@ 2020-03-11 14:19     ` Boeuf, Sebastien
  2020-03-11 15:02       ` Marc-André Lureau
  0 siblings, 1 reply; 5+ messages in thread
From: Boeuf, Sebastien @ 2020-03-11 14:19 UTC (permalink / raw)
  To: stefanha, marcandre.lureau; +Cc: berrange, qemu-devel, stefanha, mst

Hi!

On Fri, 2020-03-06 at 13:52 +0100, Marc-André Lureau wrote:
> Hi
> 
> On Fri, Mar 6, 2020 at 1:35 PM Stefan Hajnoczi <stefanha@gmail.com>
> wrote:
> > On Mon, Feb 24, 2020 at 07:24:54PM +0100, Sebastien Boeuf wrote:
> > > The vhost-user specification is not clearly stating the expected
> > > behavior from a backend program whenever the client disconnects.
> > > 
> > > This patch addresses the issue by defining the default behavior
> > > and
> > > proposing an alternative through a command line option.
> > > 
> > > By default, a backend program will terminate whenever the client
> > > disconnects, unless told otherwise through the newly introduced
> > > option --keep-listening.
> > > 
> > > Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
> > > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> > > ---
> > >  docs/interop/vhost-user.rst | 12 ++++++++++++
> > >  1 file changed, 12 insertions(+)
> > 
> > Perhaps --keep-listening should be optional?
> 
> I think it should be optional, and flagged by a capability.

Could you please elaborate on that? How can I do that?

Thanks,
Sebastien
> 
> > If the maintainers are happy with the patch as is then so am I:
> > 
> > Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> 
> 
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] docs: Update vhost-user spec regarding backend program conventions
  2020-03-11 14:19     ` Boeuf, Sebastien
@ 2020-03-11 15:02       ` Marc-André Lureau
  0 siblings, 0 replies; 5+ messages in thread
From: Marc-André Lureau @ 2020-03-11 15:02 UTC (permalink / raw)
  To: Boeuf, Sebastien, Markus Armbruster
  Cc: stefanha, berrange, qemu-devel, stefanha, mst

Hi

On Wed, Mar 11, 2020 at 3:19 PM Boeuf, Sebastien
<sebastien.boeuf@intel.com> wrote:
>
> Hi!
>
> On Fri, 2020-03-06 at 13:52 +0100, Marc-André Lureau wrote:
> > Hi
> >
> > On Fri, Mar 6, 2020 at 1:35 PM Stefan Hajnoczi <stefanha@gmail.com>
> > wrote:
> > > On Mon, Feb 24, 2020 at 07:24:54PM +0100, Sebastien Boeuf wrote:
> > > > The vhost-user specification is not clearly stating the expected
> > > > behavior from a backend program whenever the client disconnects.
> > > >
> > > > This patch addresses the issue by defining the default behavior
> > > > and
> > > > proposing an alternative through a command line option.
> > > >
> > > > By default, a backend program will terminate whenever the client
> > > > disconnects, unless told otherwise through the newly introduced
> > > > option --keep-listening.
> > > >
> > > > Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
> > > > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> > > > ---
> > > >  docs/interop/vhost-user.rst | 12 ++++++++++++
> > > >  1 file changed, 12 insertions(+)
> > >
> > > Perhaps --keep-listening should be optional?
> >
> > I think it should be optional, and flagged by a capability.
>
> Could you please elaborate on that? How can I do that?

Some backend options or behavior are optional, and advertised through
--print-capabilities.

Say --foo (optional),

--print-capabilities should have something like:

{ ...
  "features": [
     "foo",
     ...
   ]
}

The list of capabilities is documented in vhost-user.json,
VHostUserBackendCapabilities.

We lack common enum such as @VHostUserBackendCommonFeature at this
point, but it can be added.

Although we don't currently parse this file through qapi, I don't know
how to express that
VHostUserBackendGPUFeature/VHostUserBackendCapabilitiesInput inherits
from another enum. Markus, any idea?



>
> Thanks,
> Sebastien
> >
> > > If the maintainers are happy with the patch as is then so am I:
> > >
> > > Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> >
> >
> ---------------------------------------------------------------------
> Intel Corporation SAS (French simplified joint stock company)
> Registered headquarters: "Les Montalets"- 2, rue de Paris,
> 92196 Meudon Cedex, France
> Registration Number:  302 456 199 R.C.S. NANTERRE
> Capital: 4,572,000 Euros
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.



-- 
Marc-André Lureau


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-03-11 15:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-24 18:24 [PATCH v2] docs: Update vhost-user spec regarding backend program conventions Sebastien Boeuf
2020-03-06 12:34 ` Stefan Hajnoczi
2020-03-06 12:52   ` Marc-André Lureau
2020-03-11 14:19     ` Boeuf, Sebastien
2020-03-11 15:02       ` Marc-André Lureau

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.