[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 07/19] tools/vhost-user-rpmb: implement --print-capabilities
From: |
Alex Bennée |
Subject: |
[RFC PATCH 07/19] tools/vhost-user-rpmb: implement --print-capabilities |
Date: |
Fri, 25 Sep 2020 13:51:35 +0100 |
A very simple capabilities dump.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
tools/vhost-user-rpmb/main.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/tools/vhost-user-rpmb/main.c b/tools/vhost-user-rpmb/main.c
index a40a680a74ca..6b1989125bd6 100644
--- a/tools/vhost-user-rpmb/main.c
+++ b/tools/vhost-user-rpmb/main.c
@@ -7,6 +7,7 @@
*/
#include <glib.h>
+#include <stdio.h>
static gchar *socket_path;
static gint socket_fd;
@@ -20,6 +21,14 @@ static GOptionEntry options[] =
{ NULL }
};
+/* Print vhost-user.json backend program capabilities */
+static void print_capabilities(void)
+{
+ printf("{\n");
+ printf(" \"type\": \"block\"\n");
+ printf("}\n");
+}
+
int main (int argc, char *argv[])
{
GError *error = NULL;
@@ -33,5 +42,9 @@ int main (int argc, char *argv[])
exit (1);
}
+ if (print_cap) {
+ print_capabilities();
+ exit(0);
+ }
}
--
2.20.1
- [RFC PATCH 00/19] vhost-user-rpmb (Replay Protected Memory Block), Alex Bennée, 2020/09/25
- [RFC PATCH 01/19] tools/virtiofsd: add support for --socket-group, Alex Bennée, 2020/09/25
- [RFC PATCH 02/19] hw/block: add boilerplate for vhost-user-rpmb device, Alex Bennée, 2020/09/25
- [RFC PATCH 04/19] hw/block: add vhost-user-rpmb-pci boilerplate, Alex Bennée, 2020/09/25
- [RFC PATCH 05/19] virtio-pci: add notification trace points, Alex Bennée, 2020/09/25
- [RFC PATCH 03/19] hw/virtio: move virtio-pci.h into shared include space, Alex Bennée, 2020/09/25
- [RFC PATCH 06/19] tools/vhost-user-rpmb: add boilerplate and initial main, Alex Bennée, 2020/09/25
- [RFC PATCH 07/19] tools/vhost-user-rpmb: implement --print-capabilities,
Alex Bennée <=
- [RFC PATCH 08/19] tools/vhost-user-rpmb: connect to fd and instantiate basic run loop, Alex Bennée, 2020/09/25
- [RFC PATCH 09/19] tools/vhost-user-rpmb: add a --verbose/debug flags for logging, Alex Bennée, 2020/09/25
- [RFC PATCH 11/19] tools/vhost-user-rpmb: add --flash-path for backing store, Alex Bennée, 2020/09/25
- [RFC PATCH 12/19] tools/vhost-user-rpmb: import hmac_sha256 functions, Alex Bennée, 2020/09/25
- [RFC PATCH 10/19] tools/vhost-user-rpmb: handle shutdown and SIGINT/SIGHUP cleanly, Alex Bennée, 2020/09/25
- [RFC PATCH 17/19] tools/vhost-user-rpmb: add key persistence, Alex Bennée, 2020/09/25
- [RFC PATCH 15/19] tools/vhost-user-rpmb: implement VIRTIO_RPMB_REQ_DATA_WRITE, Alex Bennée, 2020/09/25