All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] vhost-vsock: report QMP event when set running
@ 2019-07-30 12:24 N. B.
  2019-07-30 13:19 ` Eric Blake
  2019-07-30 20:29 ` Michael S. Tsirkin
  0 siblings, 2 replies; 8+ messages in thread
From: N. B. @ 2019-07-30 12:24 UTC (permalink / raw)
  To: qemu-devel, eblake, armbru; +Cc: N. B., Ning Bo, mst

From: Ning Bo <n.b@live.com>

Report vsock running event so that the upper application can
control boot sequence.
see https://github.com/kata-containers/runtime/pull/1918

Signed-off-by: Ning Bo <ning.bo9@zte.com.cn>
---
 hw/virtio/vhost-vsock.c |  3 +++
 qapi/char.json          | 22 ++++++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/hw/virtio/vhost-vsock.c b/hw/virtio/vhost-vsock.c
index 0371493..a5920fd 100644
--- a/hw/virtio/vhost-vsock.c
+++ b/hw/virtio/vhost-vsock.c
@@ -22,6 +22,7 @@
 #include "qemu/iov.h"
 #include "qemu/module.h"
 #include "monitor/monitor.h"
+#include "qapi/qapi-events-char.h"
 
 enum {
     VHOST_VSOCK_SAVEVM_VERSION = 0,
@@ -68,6 +69,8 @@ static int vhost_vsock_set_running(VHostVSock *vsock, int start)
     if (ret < 0) {
         return -errno;
     }
+    qapi_event_send_vsock_running(vsock->conf.guest_cid, start != 0);
+
     return 0;
 }
 
diff --git a/qapi/char.json b/qapi/char.json
index a6e81ac..0958dd1 100644
--- a/qapi/char.json
+++ b/qapi/char.json
@@ -570,3 +570,25 @@
 { 'event': 'VSERPORT_CHANGE',
   'data': { 'id': 'str',
             'open': 'bool' } }
+
+##
+# @VSOCK_RUNNING:
+#
+# Emitted when the guest be set running.
+#
+# @cid: guest context ID
+#
+# @running: true if the vsock be set running
+#
+# Since: v4.1.0
+#
+# Example:
+#
+# <- { "event": "VSOCK_RUNNING",
+#      "data": { "cid": "123456", "running": true },
+#      "timestamp": { "seconds": 1401385907, "microseconds": 422329 } }
+#
+##
+{ 'event': 'VSOCK_RUNNING',
+  'data': { 'cid': 'uint64',
+            'running': 'bool' } }
-- 
2.9.5



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

* Re: [Qemu-devel] [PATCH] vhost-vsock: report QMP event when set running
  2019-07-30 12:24 [Qemu-devel] [PATCH] vhost-vsock: report QMP event when set running N. B.
@ 2019-07-30 13:19 ` Eric Blake
  2019-07-30 20:29 ` Michael S. Tsirkin
  1 sibling, 0 replies; 8+ messages in thread
From: Eric Blake @ 2019-07-30 13:19 UTC (permalink / raw)
  To: N. B., qemu-devel, armbru; +Cc: Ning Bo, mst


[-- Attachment #1.1: Type: text/plain, Size: 1396 bytes --]

On 7/30/19 7:24 AM, N. B. wrote:
> From: Ning Bo <n.b@live.com>
> 
> Report vsock running event so that the upper application can
> control boot sequence.
> see https://github.com/kata-containers/runtime/pull/1918
> 
> Signed-off-by: Ning Bo <ning.bo9@zte.com.cn>

Your From: and S-o-b: differ from one another, which can make crawling
through git history in search of contributor statistics a bit harder.
Can you fix your git settings to use the same address in both places,
and/or contribute a patch to .mailmap to consolidate your contributions
under a single preferred address?

> ---
>  hw/virtio/vhost-vsock.c |  3 +++
>  qapi/char.json          | 22 ++++++++++++++++++++++
>  2 files changed, 25 insertions(+)
> 

> +++ b/qapi/char.json
> @@ -570,3 +570,25 @@
>  { 'event': 'VSERPORT_CHANGE',
>    'data': { 'id': 'str',
>              'open': 'bool' } }
> +
> +##
> +# @VSOCK_RUNNING:
> +#
> +# Emitted when the guest be set running.

s/be set running/changes the vsock status/

> +#
> +# @cid: guest context ID
> +#
> +# @running: true if the vsock be set running

s/be set/is/

> +#
> +# Since: v4.1.0

Not our typical spelling, and as a new feature it is too late for 4.1.
This should read:

# Since: 4.2

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


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

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

* Re: [Qemu-devel] [PATCH] vhost-vsock: report QMP event when set running
  2019-07-30 12:24 [Qemu-devel] [PATCH] vhost-vsock: report QMP event when set running N. B.
  2019-07-30 13:19 ` Eric Blake
@ 2019-07-30 20:29 ` Michael S. Tsirkin
  2019-08-15 13:20   ` Stefan Hajnoczi
  1 sibling, 1 reply; 8+ messages in thread
From: Michael S. Tsirkin @ 2019-07-30 20:29 UTC (permalink / raw)
  To: N. B.; +Cc: Ning Bo, qemu-devel, stefanha, armbru

On Tue, Jul 30, 2019 at 12:24:27PM +0000, N. B. wrote:
> From: Ning Bo <n.b@live.com>
> 
> Report vsock running event so that the upper application can
> control boot sequence.
> see https://github.com/kata-containers/runtime/pull/1918
> 
> Signed-off-by: Ning Bo <ning.bo9@zte.com.cn>

Cc Stefan.

Stefan, are you willing to maintain virtio/vhost-vsock in qemu, too?

If yes let's add an entry to MAINTAINERS, ok?

> ---
>  hw/virtio/vhost-vsock.c |  3 +++
>  qapi/char.json          | 22 ++++++++++++++++++++++
>  2 files changed, 25 insertions(+)
> 
> diff --git a/hw/virtio/vhost-vsock.c b/hw/virtio/vhost-vsock.c
> index 0371493..a5920fd 100644
> --- a/hw/virtio/vhost-vsock.c
> +++ b/hw/virtio/vhost-vsock.c
> @@ -22,6 +22,7 @@
>  #include "qemu/iov.h"
>  #include "qemu/module.h"
>  #include "monitor/monitor.h"
> +#include "qapi/qapi-events-char.h"
>  
>  enum {
>      VHOST_VSOCK_SAVEVM_VERSION = 0,
> @@ -68,6 +69,8 @@ static int vhost_vsock_set_running(VHostVSock *vsock, int start)
>      if (ret < 0) {
>          return -errno;
>      }
> +    qapi_event_send_vsock_running(vsock->conf.guest_cid, start != 0);
> +
>      return 0;
>  }
>  
> diff --git a/qapi/char.json b/qapi/char.json
> index a6e81ac..0958dd1 100644
> --- a/qapi/char.json
> +++ b/qapi/char.json
> @@ -570,3 +570,25 @@
>  { 'event': 'VSERPORT_CHANGE',
>    'data': { 'id': 'str',
>              'open': 'bool' } }
> +
> +##
> +# @VSOCK_RUNNING:
> +#
> +# Emitted when the guest be set running.
> +#
> +# @cid: guest context ID
> +#
> +# @running: true if the vsock be set running
> +#
> +# Since: v4.1.0
> +#
> +# Example:
> +#
> +# <- { "event": "VSOCK_RUNNING",
> +#      "data": { "cid": "123456", "running": true },
> +#      "timestamp": { "seconds": 1401385907, "microseconds": 422329 } }
> +#
> +##
> +{ 'event': 'VSOCK_RUNNING',
> +  'data': { 'cid': 'uint64',
> +            'running': 'bool' } }
> -- 
> 2.9.5


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

* Re: [Qemu-devel] [PATCH] vhost-vsock: report QMP event when set running
  2019-07-30 20:29 ` Michael S. Tsirkin
@ 2019-08-15 13:20   ` Stefan Hajnoczi
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Hajnoczi @ 2019-08-15 13:20 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: N. B., Ning Bo, qemu-devel, stefanha, armbru

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

On Tue, Jul 30, 2019 at 04:29:35PM -0400, Michael S. Tsirkin wrote:
> On Tue, Jul 30, 2019 at 12:24:27PM +0000, N. B. wrote:
> > From: Ning Bo <n.b@live.com>
> > 
> > Report vsock running event so that the upper application can
> > control boot sequence.
> > see https://github.com/kata-containers/runtime/pull/1918
> > 
> > Signed-off-by: Ning Bo <ning.bo9@zte.com.cn>
> 
> Cc Stefan.
> 
> Stefan, are you willing to maintain virtio/vhost-vsock in qemu, too?
> 
> If yes let's add an entry to MAINTAINERS, ok?

Yes, I'll send a patch.

Stefan

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

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

* Re: [Qemu-devel] [PATCH] vhost-vsock: report QMP event when set running
  2019-08-01 15:25 ` Markus Armbruster
@ 2019-08-01 19:15   ` Michael S. Tsirkin
  0 siblings, 0 replies; 8+ messages in thread
From: Michael S. Tsirkin @ 2019-08-01 19:15 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: Ning Bo, qemu-devel

On Thu, Aug 01, 2019 at 05:25:04PM +0200, Markus Armbruster wrote:
> Ning Bo <ning.bo9@zte.com.cn> writes:
> 
> > Report vsock running event so that the upper application can
> > control boot sequence.
> > see https://github.com/kata-containers/runtime/pull/1918
> 
> Please provide a more complete summary of the use case in the commit
> message.  What exactly is the problem?  What is the proposed solution,
> and how does it make use of the new event?
> 
> > Signed-off-by: Ning Bo <ning.bo9@zte.com.cn>


Also it would seem that it should be possible to detect
port listen state change just by trying to connect to it.
Why isn't that an option?



> > ---
> >  hw/virtio/vhost-vsock.c |  3 +++
> >  qapi/char.json          | 22 ++++++++++++++++++++++
> >  2 files changed, 25 insertions(+)
> >
> > diff --git a/hw/virtio/vhost-vsock.c b/hw/virtio/vhost-vsock.c
> > index 0371493..a5920fd 100644
> > --- a/hw/virtio/vhost-vsock.c
> > +++ b/hw/virtio/vhost-vsock.c
> > @@ -22,6 +22,7 @@
> >  #include "qemu/iov.h"
> >  #include "qemu/module.h"
> >  #include "monitor/monitor.h"
> > +#include "qapi/qapi-events-char.h"
> >  
> >  enum {
> >      VHOST_VSOCK_SAVEVM_VERSION = 0,
> > @@ -68,6 +69,8 @@ static int vhost_vsock_set_running(VHostVSock *vsock, int start)
> >      if (ret < 0) {
> >          return -errno;
> >      }
> > +    qapi_event_send_vsock_running(vsock->conf.guest_cid, start != 0);
> > +
> >      return 0;
> >  }
> >  
> > diff --git a/qapi/char.json b/qapi/char.json
> > index a6e81ac..7b746e3 100644
> > --- a/qapi/char.json
> > +++ b/qapi/char.json
> > @@ -570,3 +570,25 @@
> >  { 'event': 'VSERPORT_CHANGE',
> >    'data': { 'id': 'str',
> >              'open': 'bool' } }
> > +
> > +##
> > +# @VSOCK_RUNNING:
> > +#
> > +# Emitted when the guest changes the vsock status.
> > +#
> > +# @cid: guest context ID
> > +#
> > +# @running: true if the vsock is running
> > +#
> > +# Since: v4.2
> > +#
> > +# Example:
> > +#
> > +# <- { "event": "VSOCK_RUNNING",
> > +#      "data": { "cid": "123456", "running": true },
> > +#      "timestamp": { "seconds": 1401385907, "microseconds": 422329 } }
> > +#
> > +##
> > +{ 'event': 'VSOCK_RUNNING',
> > +  'data': { 'cid': 'uint64',
> > +            'running': 'bool' } }
> 
> Can you explain why you put this into char.json?
> 
> The event traces successful calls of vhost_vsock_set_running().  I have
> no idea what vhost_vsock_set_running() does (pardon my ignorance).  Can
> you point me to a specification?
> 
> Its @start parameter is int.  The event's @running is bool.  Zero gets
> mapped to false, non-zero to true.  Are you sure all non-zero values are
> equivalent, and will remain equivalent?


Allowing guest to emit events at a high speed 



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

* Re: [Qemu-devel] [PATCH] vhost-vsock: report QMP event when set running
  2019-08-01  7:28 Ning Bo
  2019-08-01 11:17 ` Eric Blake
@ 2019-08-01 15:25 ` Markus Armbruster
  2019-08-01 19:15   ` Michael S. Tsirkin
  1 sibling, 1 reply; 8+ messages in thread
From: Markus Armbruster @ 2019-08-01 15:25 UTC (permalink / raw)
  To: Ning Bo; +Cc: qemu-devel, mst

Ning Bo <ning.bo9@zte.com.cn> writes:

> Report vsock running event so that the upper application can
> control boot sequence.
> see https://github.com/kata-containers/runtime/pull/1918

Please provide a more complete summary of the use case in the commit
message.  What exactly is the problem?  What is the proposed solution,
and how does it make use of the new event?

> Signed-off-by: Ning Bo <ning.bo9@zte.com.cn>
> ---
>  hw/virtio/vhost-vsock.c |  3 +++
>  qapi/char.json          | 22 ++++++++++++++++++++++
>  2 files changed, 25 insertions(+)
>
> diff --git a/hw/virtio/vhost-vsock.c b/hw/virtio/vhost-vsock.c
> index 0371493..a5920fd 100644
> --- a/hw/virtio/vhost-vsock.c
> +++ b/hw/virtio/vhost-vsock.c
> @@ -22,6 +22,7 @@
>  #include "qemu/iov.h"
>  #include "qemu/module.h"
>  #include "monitor/monitor.h"
> +#include "qapi/qapi-events-char.h"
>  
>  enum {
>      VHOST_VSOCK_SAVEVM_VERSION = 0,
> @@ -68,6 +69,8 @@ static int vhost_vsock_set_running(VHostVSock *vsock, int start)
>      if (ret < 0) {
>          return -errno;
>      }
> +    qapi_event_send_vsock_running(vsock->conf.guest_cid, start != 0);
> +
>      return 0;
>  }
>  
> diff --git a/qapi/char.json b/qapi/char.json
> index a6e81ac..7b746e3 100644
> --- a/qapi/char.json
> +++ b/qapi/char.json
> @@ -570,3 +570,25 @@
>  { 'event': 'VSERPORT_CHANGE',
>    'data': { 'id': 'str',
>              'open': 'bool' } }
> +
> +##
> +# @VSOCK_RUNNING:
> +#
> +# Emitted when the guest changes the vsock status.
> +#
> +# @cid: guest context ID
> +#
> +# @running: true if the vsock is running
> +#
> +# Since: v4.2
> +#
> +# Example:
> +#
> +# <- { "event": "VSOCK_RUNNING",
> +#      "data": { "cid": "123456", "running": true },
> +#      "timestamp": { "seconds": 1401385907, "microseconds": 422329 } }
> +#
> +##
> +{ 'event': 'VSOCK_RUNNING',
> +  'data': { 'cid': 'uint64',
> +            'running': 'bool' } }

Can you explain why you put this into char.json?

The event traces successful calls of vhost_vsock_set_running().  I have
no idea what vhost_vsock_set_running() does (pardon my ignorance).  Can
you point me to a specification?

Its @start parameter is int.  The event's @running is bool.  Zero gets
mapped to false, non-zero to true.  Are you sure all non-zero values are
equivalent, and will remain equivalent?


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

* Re: [Qemu-devel] [PATCH] vhost-vsock: report QMP event when set running
  2019-08-01  7:28 Ning Bo
@ 2019-08-01 11:17 ` Eric Blake
  2019-08-01 15:25 ` Markus Armbruster
  1 sibling, 0 replies; 8+ messages in thread
From: Eric Blake @ 2019-08-01 11:17 UTC (permalink / raw)
  To: Ning Bo, qemu-devel, armbru; +Cc: mst


[-- Attachment #1.1: Type: text/plain, Size: 1131 bytes --]

On 8/1/19 2:28 AM, Ning Bo wrote:
> Report vsock running event so that the upper application can
> control boot sequence.
> see https://github.com/kata-containers/runtime/pull/1918
> 
> Signed-off-by: Ning Bo <ning.bo9@zte.com.cn>
> ---

Since this is an update to an earlier version you posted, it is helpful
to include 'v2' in the subject line ('git format-patch -v2' or 'git
send-email -v2' can do that on your behalf), as well as to document here
after the --- separator how it differs from v1.

More patch submission hints at https://wiki.qemu.org/Contribute/SubmitAPatch

> +++ b/qapi/char.json
> @@ -570,3 +570,25 @@
>  { 'event': 'VSERPORT_CHANGE',
>    'data': { 'id': 'str',
>              'open': 'bool' } }
> +
> +##
> +# @VSOCK_RUNNING:
> +#
> +# Emitted when the guest changes the vsock status.
> +#
> +# @cid: guest context ID
> +#
> +# @running: true if the vsock is running
> +#
> +# Since: v4.2

Still not consistent with other uses. s/v4.2/4.2/


-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


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

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

* [Qemu-devel] [PATCH] vhost-vsock: report QMP event when set running
@ 2019-08-01  7:28 Ning Bo
  2019-08-01 11:17 ` Eric Blake
  2019-08-01 15:25 ` Markus Armbruster
  0 siblings, 2 replies; 8+ messages in thread
From: Ning Bo @ 2019-08-01  7:28 UTC (permalink / raw)
  To: qemu-devel, eblake, armbru; +Cc: Ning Bo, mst

Report vsock running event so that the upper application can
control boot sequence.
see https://github.com/kata-containers/runtime/pull/1918

Signed-off-by: Ning Bo <ning.bo9@zte.com.cn>
---
 hw/virtio/vhost-vsock.c |  3 +++
 qapi/char.json          | 22 ++++++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/hw/virtio/vhost-vsock.c b/hw/virtio/vhost-vsock.c
index 0371493..a5920fd 100644
--- a/hw/virtio/vhost-vsock.c
+++ b/hw/virtio/vhost-vsock.c
@@ -22,6 +22,7 @@
 #include "qemu/iov.h"
 #include "qemu/module.h"
 #include "monitor/monitor.h"
+#include "qapi/qapi-events-char.h"
 
 enum {
     VHOST_VSOCK_SAVEVM_VERSION = 0,
@@ -68,6 +69,8 @@ static int vhost_vsock_set_running(VHostVSock *vsock, int start)
     if (ret < 0) {
         return -errno;
     }
+    qapi_event_send_vsock_running(vsock->conf.guest_cid, start != 0);
+
     return 0;
 }
 
diff --git a/qapi/char.json b/qapi/char.json
index a6e81ac..7b746e3 100644
--- a/qapi/char.json
+++ b/qapi/char.json
@@ -570,3 +570,25 @@
 { 'event': 'VSERPORT_CHANGE',
   'data': { 'id': 'str',
             'open': 'bool' } }
+
+##
+# @VSOCK_RUNNING:
+#
+# Emitted when the guest changes the vsock status.
+#
+# @cid: guest context ID
+#
+# @running: true if the vsock is running
+#
+# Since: v4.2
+#
+# Example:
+#
+# <- { "event": "VSOCK_RUNNING",
+#      "data": { "cid": "123456", "running": true },
+#      "timestamp": { "seconds": 1401385907, "microseconds": 422329 } }
+#
+##
+{ 'event': 'VSOCK_RUNNING',
+  'data': { 'cid': 'uint64',
+            'running': 'bool' } }
-- 
2.9.5



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

end of thread, other threads:[~2019-08-15 13:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-30 12:24 [Qemu-devel] [PATCH] vhost-vsock: report QMP event when set running N. B.
2019-07-30 13:19 ` Eric Blake
2019-07-30 20:29 ` Michael S. Tsirkin
2019-08-15 13:20   ` Stefan Hajnoczi
2019-08-01  7:28 Ning Bo
2019-08-01 11:17 ` Eric Blake
2019-08-01 15:25 ` Markus Armbruster
2019-08-01 19:15   ` Michael S. Tsirkin

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.