mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
sheepdog: Adjust logic to break while loop to avoid Coverity error
Change the various "return -1" to "break". Avoids Coverity error and perhaps other/future analyzer issues.
This commit is contained in:
parent
40e904490f
commit
80e524de86
@ -66,7 +66,7 @@ virStorageBackendSheepdogParseNodeInfo(virStoragePoolDefPtr pool,
|
||||
if ((next = strchr(p, '\n')))
|
||||
++next;
|
||||
else
|
||||
return -1;
|
||||
break;
|
||||
|
||||
if (!STRPREFIX(p, "Total "))
|
||||
continue;
|
||||
@ -74,13 +74,13 @@ virStorageBackendSheepdogParseNodeInfo(virStoragePoolDefPtr pool,
|
||||
p = p + 6;
|
||||
|
||||
if (virStrToLong_ull(p, &end, 10, &pool->capacity) < 0)
|
||||
return -1;
|
||||
break;
|
||||
|
||||
if ((p = end + 1) > next)
|
||||
return -1;
|
||||
break;
|
||||
|
||||
if (virStrToLong_ull(p, &end, 10, &pool->allocation) < 0)
|
||||
return -1;
|
||||
break;
|
||||
|
||||
pool->available = pool->capacity - pool->allocation;
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user