mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
util: Change return type of virSCSIVHostDeviceSetUsedBy to void
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>
This commit is contained in:
parent
20afcd4b14
commit
0e1a848733
@ -1667,8 +1667,7 @@ virHostdevPrepareSCSIVHostDevices(virHostdevManager *mgr,
|
|||||||
if (!(host = virSCSIVHostDeviceNew(hostsrc->wwpn)))
|
if (!(host = virSCSIVHostDeviceNew(hostsrc->wwpn)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (virSCSIVHostDeviceSetUsedBy(host, drv_name, dom_name) < 0)
|
virSCSIVHostDeviceSetUsedBy(host, drv_name, dom_name);
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (virSCSIVHostDeviceListAdd(list, host) < 0)
|
if (virSCSIVHostDeviceListAdd(list, host) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -193,7 +193,7 @@ virSCSIVHostDeviceListNew(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
void
|
||||||
virSCSIVHostDeviceSetUsedBy(virSCSIVHostDevice *dev,
|
virSCSIVHostDeviceSetUsedBy(virSCSIVHostDevice *dev,
|
||||||
const char *drvname,
|
const char *drvname,
|
||||||
const char *domname)
|
const char *domname)
|
||||||
@ -202,8 +202,6 @@ virSCSIVHostDeviceSetUsedBy(virSCSIVHostDevice *dev,
|
|||||||
VIR_FREE(dev->used_by_domname);
|
VIR_FREE(dev->used_by_domname);
|
||||||
dev->used_by_drvname = g_strdup(drvname);
|
dev->used_by_drvname = g_strdup(drvname);
|
||||||
dev->used_by_domname = g_strdup(domname);
|
dev->used_by_domname = g_strdup(domname);
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -50,9 +50,9 @@ void virSCSIVHostDeviceListDel(virSCSIVHostDeviceList *list,
|
|||||||
virSCSIVHostDevice *dev);
|
virSCSIVHostDevice *dev);
|
||||||
virSCSIVHostDeviceList *virSCSIVHostDeviceListNew(void);
|
virSCSIVHostDeviceList *virSCSIVHostDeviceListNew(void);
|
||||||
virSCSIVHostDevice *virSCSIVHostDeviceNew(const char *name);
|
virSCSIVHostDevice *virSCSIVHostDeviceNew(const char *name);
|
||||||
int virSCSIVHostDeviceSetUsedBy(virSCSIVHostDevice *dev,
|
void virSCSIVHostDeviceSetUsedBy(virSCSIVHostDevice *dev,
|
||||||
const char *drvname,
|
const char *drvname,
|
||||||
const char *domname);
|
const char *domname);
|
||||||
void virSCSIVHostDeviceGetUsedBy(virSCSIVHostDevice *dev,
|
void virSCSIVHostDeviceGetUsedBy(virSCSIVHostDevice *dev,
|
||||||
const char **drv_name,
|
const char **drv_name,
|
||||||
const char **dom_name);
|
const char **dom_name);
|
||||||
|
Loading…
Reference in New Issue
Block a user