vhost-vsock: report QMP event when set running
PATCH 1/1 vhost-vsock: report QMP event when set running
Report vsock running event so that the upper application can control boot sequence.
see https://github.com/kata-containers/runtime/pull/1918
--- hw/virtio/vhost-vsock.c | 3 +++ qapi/char.json | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+)
hw/virtio/vhost-vsock.c +3 -0
@@ -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 ; }
qapi/char.json +22 -0
@@ -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' } }
Signature · 1 line
2.9.5
Quoted 6 lines · Ning Bo
Report vsock running event so that the upper application can control boot sequence.
see https://github.com/kata-containers/runtime/pull/1918Signed-off-by Ning Bo <[email protected]>---
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
Quoted 6 lines
+++
b/qapi/char.jsonqapi/char.json +1
-0@@ -570,3 +570,25 @@ { 'event': 'VSERPORT_CHANGE', 'data': { 'id': 'str', 'open': 'bool' } } +
qapi/char.json line 583
Quoted 10 lines
qapi/char.json +10
-0+## +# @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/
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
Quoted 3 lines · Ning Bo
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?
Quoted 47 lines
Signed-off-by Ning Bo <[email protected]>--- hw/virtio/vhost-vsock.c | 3 +++ qapi/char.json | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+)hw/virtio/vhost-vsock.c +3
-0@@ -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 ; }qapi/char.json +12
-0@@ -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 +#
qapi/char.json line 594
Quoted 10 lines
qapi/char.json +10
-0+# 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?
Quoted 11 lines · Markus Armbruster
Quoted 3 lines · Ning Bo
Report vsock running event so that the upper application can control boot sequence.
see https://github.com/kata-containers/runtime/pull/1918Please 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?
Quoted 1 line
Signed-off-by Ning Bo <[email protected]>
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?
Quoted 59 lines
Quoted 46 lines
--- hw/virtio/vhost-vsock.c | 3 +++ qapi/char.json | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+)hw/virtio/vhost-vsock.c +3
-0@@ -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 ; }qapi/char.json +12
-0@@ -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 +#qapi/char.json line 594
Quoted 10 lines
qapi/char.json +10
-0+# 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?
Quoted 7 lines
The event traces successful calls of
vhost_vsock_set_running(). I have no idea whatvhost_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