Skip to contentSkip to conversation

libvhost-user: fix clang enum-conversion warning

PATCH In review Marc-André Lureau 2 participants 2 messages Aug 30, 2018 – Nov 15, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libvhost-user: fix clang enum-conversion warning

Now that the VhostUserMsg.request field is used for both master & slave requests, since commit d84599f56c820d8c1ac9928a76500dcdfbbf194d:

contrib/libvhost-user/libvhost-user.c:953:20: error: implicit conversion from enumeration type 'enum VhostUserSlaveRequest' to different enumeration type 'VhostUserRequest' (aka 'enum VhostUserRequest') [-Werror,-Wenum-conversion]
.request = VHOST_USER_SLAVE_VRING_HOST_NOTIFIER_MSG,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---
 contrib/libvhost-user/libvhost-user.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
contrib/libvhost-user/libvhost-user.h +1 -1
index 4aa55b4d2d..c0133b7f3f 100644
@@ -145,7 +145,7 @@ typedef struct VhostUserVringArea {
 #endif
 
 typedef struct VhostUserMsg {
-    VhostUserRequest request;
+    int request;
 
 #define VHOST_USER_VERSION_MASK     (0x3)
 #define VHOST_USER_REPLY_MASK       (0x1 << 2)
Signature · 1 line
2.19.0.rc0.48.gb9dfa238d5
#1 lore raw
Quoted 9 lines · Marc-André Lureau

Now that the VhostUserMsg.request field is used for both master & slave requests, since commit d84599f56c820d8c1ac9928a76500dcdfbbf194d:

contrib/libvhost-user/libvhost-user.c:953:20: error: implicit conversion from enumeration type 'enum VhostUserSlaveRequest' to different enumeration type 'VhostUserRequest' (aka 'enum VhostUserRequest') [-Werror,-Wenum-conversion]
.request = VHOST_USER_SLAVE_VRING_HOST_NOTIFIER_MSG,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ping,
thanks

Quoted 21 lines
---
 contrib/libvhost-user/libvhost-user.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
contrib/libvhost-user/libvhost-user.h +1 -2
index 4aa55b4d2d..c0133b7f3f 100644
@@ -145,7 +145,7 @@ typedef struct VhostUserVringArea {
 #endif
 
 typedef struct VhostUserMsg {
-    VhostUserRequest request;
+    int request;
 
 #define VHOST_USER_VERSION_MASK     (0x3)
 #define VHOST_USER_REPLY_MASK       (0x1 << 2)
--

2.19.0.rc0.48.gb9dfa238d5

Signature · 1 line
Marc-André Lureau