]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: Change return type of virSCSIVHostDeviceSetUsedBy to void
authorAlexander Kuznetsov <kuznetsovam@altlinux.org>
Mon, 16 Dec 2024 09:41:07 +0000 (12:41 +0300)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 16 Dec 2024 10:28:21 +0000 (11:28 +0100)
This function return value is invariant since 18f3771, so change
its type and remove all dependent checks.

Found by Linux Verification Center (linuxtesting.org) with Svace.

Reported-by: Pavel Nekrasov <p.nekrasov@fobos-nt.ru>
Signed-off-by: Alexander Kuznetsov <kuznetsovam@altlinux.org>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
src/hypervisor/virhostdev.c
src/util/virscsivhost.c
src/util/virscsivhost.h

index 84c036e075d46db9b7e77191a2196db46f8d7302..0a1d8500d46612e427c19f892944494ae1c4184a 100644 (file)
@@ -1667,8 +1667,7 @@ virHostdevPrepareSCSIVHostDevices(virHostdevManager *mgr,
         if (!(host = virSCSIVHostDeviceNew(hostsrc->wwpn)))
             return -1;
 
-        if (virSCSIVHostDeviceSetUsedBy(host, drv_name, dom_name) < 0)
-            return -1;
+        virSCSIVHostDeviceSetUsedBy(host, drv_name, dom_name);
 
         if (virSCSIVHostDeviceListAdd(list, host) < 0)
             return -1;
index 15024d7106453b783ad17a7957d08efb71333160..6934fd574bca2b409bfe0b603ad85304daec9e4e 100644 (file)
@@ -193,7 +193,7 @@ virSCSIVHostDeviceListNew(void)
 }
 
 
-int
+void
 virSCSIVHostDeviceSetUsedBy(virSCSIVHostDevice *dev,
                             const char *drvname,
                             const char *domname)
@@ -202,8 +202,6 @@ virSCSIVHostDeviceSetUsedBy(virSCSIVHostDevice *dev,
     VIR_FREE(dev->used_by_domname);
     dev->used_by_drvname = g_strdup(drvname);
     dev->used_by_domname = g_strdup(domname);
-
-    return 0;
 }
 
 
index a7299382dbdaa7c8932d73b1700948cb9316216e..48b5fdec78ca10897b09dd97c4fc98436312c30a 100644 (file)
@@ -50,9 +50,9 @@ void virSCSIVHostDeviceListDel(virSCSIVHostDeviceList *list,
                                virSCSIVHostDevice *dev);
 virSCSIVHostDeviceList *virSCSIVHostDeviceListNew(void);
 virSCSIVHostDevice *virSCSIVHostDeviceNew(const char *name);
-int virSCSIVHostDeviceSetUsedBy(virSCSIVHostDevice *dev,
-                                const char *drvname,
-                                const char *domname);
+void virSCSIVHostDeviceSetUsedBy(virSCSIVHostDevice *dev,
+                                 const char *drvname,
+                                 const char *domname);
 void virSCSIVHostDeviceGetUsedBy(virSCSIVHostDevice *dev,
                                  const char **drv_name,
                                  const char **dom_name);