Skip to contentSkip to conversation

docs: Update vhost-user spec regarding backend program conventions

PATCH In review Sebastien Boeuf 3 participants 5 messages Feb 24, 2020 – Mar 11, 2020

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 docs: Update vhost-user spec regarding backend program conventions

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.

---
 docs/interop/vhost-user.rst | 12 ++++++++++++
 1 file changed, 12 insertions(+)
docs/interop/vhost-user.rst +12 -0
index 5f8b3a456b..078f8e2e57 100644
@@ -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
Signature · 13 lines
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.
Reviewed-by on v2 1/1
#1 lore raw
Quoted 10 lines · Sebastien Boeuf

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.

Quoted 5 lines
---
 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:

#2 lore raw

Hi

Quoted 12 lines · Stefan Hajnoczi
Quoted 10 lines · Sebastien Boeuf

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.

Quoted 7 lines
Quoted 5 lines
---
 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.

Quoted 4 lines

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

Signature · 1 line
Marc-André Lureau
#3 lore raw

Hi!

Quoted 22 lines · Marc-André Lureau

Hi

Quoted 18 lines · Stefan Hajnoczi
Quoted 16 lines · Sebastien Boeuf

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.

---
 docs/interop/vhost-user.rst | 12 ++++++++++++
 1 file changed, 12 insertions(+)
Quoted 3 lines
Quoted 1 line

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

Quoted 6 lines
Quoted 4 lines

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

---------------------------------------------------------------------
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.

#4 lore raw

Hi

Quoted 26 lines · Sebastien

Hi!

Quoted 22 lines · Marc-André Lureau

Hi

Quoted 18 lines · Stefan Hajnoczi
Quoted 16 lines · Sebastien Boeuf

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.

---
 docs/interop/vhost-user.rst | 12 ++++++++++++
 1 file changed, 12 insertions(+)
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

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?

Quoted 20 lines

Thanks,
Sebastien

Quoted 6 lines
Quoted 4 lines

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

---------------------------------------------------------------------
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.

Signature · 1 line
Marc-André Lureau