]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
Fix parameter type in vhost migration log path
authorRaphael Norwitz <raphael.s.norwitz@gmail.com>
Thu, 7 May 2020 21:37:58 +0000 (17:37 -0400)
committerLaurent Vivier <laurent@vivier.eu>
Tue, 9 Jun 2020 16:46:41 +0000 (18:46 +0200)
The ‘enable’ parameter to the vhost_migration_log() function is given as
an int, but "true"/"false" values are passed in wherever it is invoked.
Inside the function itself it is only ever compared with bool values.
Therefore the parameter value itself should be changed to bool.

Signed-off-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <CAFubqFtqNZw=Y-ar3N=3zTQi6LkKg_G-7W7OOHHbE7Y1fV7HAQ@mail.gmail.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
hw/virtio/vhost.c

index aff98a0ede56d5ce7d1d20e8c94ea7d06da4e077..aa06a369191946b3dd705adf7d29be4d95b50591 100644 (file)
@@ -809,12 +809,12 @@ err_features:
     return r;
 }
 
-static int vhost_migration_log(MemoryListener *listener, int enable)
+static int vhost_migration_log(MemoryListener *listener, bool enable)
 {
     struct vhost_dev *dev = container_of(listener, struct vhost_dev,
                                          memory_listener);
     int r;
-    if (!!enable == dev->log_enabled) {
+    if (enable == dev->log_enabled) {
         return 0;
     }
     if (!dev->started) {