qemu-devel
[Top][All Lists]
Advanced

[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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]