summary refs log tree commit diff stats
path: root/subprojects/libvduse/libvduse.c
diff options
context:
space:
mode:
authorXie Yongji <xieyongji@bytedance.com>2022-07-06 17:56:22 +0800
committerKevin Wolf <kwolf@redhat.com>2022-08-02 11:01:41 +0200
commite7156ff7cb3ea79c5c859168484a216c431bdd5a (patch)
treed111c9bbdbb9baa7b956a4e3f2522b3f87574d7c /subprojects/libvduse/libvduse.c
parent77e3f038af1764983087e3551a0fde9951952c4d (diff)
downloadfocaccia-qemu-e7156ff7cb3ea79c5c859168484a216c431bdd5a.tar.gz
focaccia-qemu-e7156ff7cb3ea79c5c859168484a216c431bdd5a.zip
libvduse: Fix the incorrect function name
In vduse_name_is_valid(), we actually check whether
the name is invalid or not. So let's change the
function name to vduse_name_is_invalid() to match
the behavior.

Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20220706095624.328-2-xieyongji@bytedance.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'subprojects/libvduse/libvduse.c')
-rw-r--r--subprojects/libvduse/libvduse.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/subprojects/libvduse/libvduse.c b/subprojects/libvduse/libvduse.c
index 9a2bcec282..6374933881 100644
--- a/subprojects/libvduse/libvduse.c
+++ b/subprojects/libvduse/libvduse.c
@@ -1193,7 +1193,7 @@ static int vduse_dev_init(VduseDev *dev, const char *name,
     return 0;
 }
 
-static inline bool vduse_name_is_valid(const char *name)
+static inline bool vduse_name_is_invalid(const char *name)
 {
     return strlen(name) >= VDUSE_NAME_MAX || strstr(name, "..");
 }
@@ -1242,7 +1242,7 @@ VduseDev *vduse_dev_create_by_name(const char *name, uint16_t num_queues,
     VduseDev *dev;
     int ret;
 
-    if (!name || vduse_name_is_valid(name) || !ops ||
+    if (!name || vduse_name_is_invalid(name) || !ops ||
         !ops->enable_queue || !ops->disable_queue) {
         fprintf(stderr, "Invalid parameter for vduse\n");
         return NULL;
@@ -1276,7 +1276,7 @@ VduseDev *vduse_dev_create(const char *name, uint32_t device_id,
     struct vduse_dev_config *dev_config;
     size_t size = offsetof(struct vduse_dev_config, config);
 
-    if (!name || vduse_name_is_valid(name) ||
+    if (!name || vduse_name_is_invalid(name) ||
         !has_feature(features,  VIRTIO_F_VERSION_1) || !config ||
         !config_size || !ops || !ops->enable_queue || !ops->disable_queue) {
         fprintf(stderr, "Invalid parameter for vduse\n");