[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/6] vhost-user-server: use DevicePanicNotifierFn everywhere
From: |
Stefan Hajnoczi |
Subject: |
[PATCH 6/6] vhost-user-server: use DevicePanicNotifierFn everywhere |
Date: |
Fri, 19 Jun 2020 13:00:46 +0100 |
Use the DevicePanicNotifierFn typedef instead of open-coding the
function pointer. Writing the code this way avoids duplicating the
function prototype.
Also use the VuServer typedef instead of struct VuServer as required by
QEMU's coding style.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
util/vhost-user-server.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/util/vhost-user-server.h b/util/vhost-user-server.h
index 584aab3da5..37aca1e5aa 100644
--- a/util/vhost-user-server.h
+++ b/util/vhost-user-server.h
@@ -25,10 +25,13 @@ typedef struct KickInfo {
vu_watch_cb cb;
} KickInfo;
-typedef struct VuServer {
+typedef struct VuServer VuServer;
+typedef void DevicePanicNotifierFn(VuServer *server);
+
+struct VuServer {
QIONetListener *listener;
AioContext *ctx;
- void (*device_panic_notifier)(struct VuServer *server) ;
+ DevicePanicNotifierFn *device_panic_notifier;
int max_queues;
const VuDevIface *vu_iface;
VuDev vu_dev;
@@ -41,10 +44,7 @@ typedef struct VuServer {
KickInfo *kick_info; /* an array with the length of the queue number */
/* restart coroutine co_trip if AIOContext is changed */
bool aio_context_changed;
-} VuServer;
-
-
-typedef void DevicePanicNotifierFn(struct VuServer *server);
+};
bool vhost_user_server_start(VuServer *server,
SocketAddress *unix_socket,
--
2.26.2
- [PATCH v9 0/5] vhost-user block device backend implementation, Coiby Xu, 2020/06/14
- [PATCH v9 1/5] Allow vu_message_read to be replaced, Coiby Xu, 2020/06/14
- [PATCH v9 2/5] generic vhost user server, Coiby Xu, 2020/06/14
- [PATCH v9 3/5] move logical block size check function to a common utility function, Coiby Xu, 2020/06/14
- Re: [PATCH v9 3/5] move logical block size check function to a common utility function, Kevin Wolf, 2020/06/18
- [PATCH 1/6] block-helpers: move MIN/MAX_BLOCK_SIZE constants into header file, Stefan Hajnoczi, 2020/06/19
- [PATCH 2/6] block-helpers: switch to int64_t block size values, Stefan Hajnoczi, 2020/06/19
- [PATCH 3/6] block-helpers: rename check_logical_block_size() to check_block_size(), Stefan Hajnoczi, 2020/06/19
- [PATCH 4/6] block-helpers: use local_err in case errp is NULL, Stefan Hajnoczi, 2020/06/19
- [PATCH 5/6] block-helpers: keep the copyright line from the original file, Stefan Hajnoczi, 2020/06/19
- [PATCH 6/6] block-helpers: update doc comment in gtkdoc style, Stefan Hajnoczi, 2020/06/19