mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
storage: Clean up return value checking
Rather than special casing the VIR_STORAGE_BLKID_PROBE_UNKNOWN after calling virStorageBackendBLKIDFindPart, just allow the switch statement handle setting ret = -2.
This commit is contained in:
parent
d1f5dfc416
commit
f462f9ad6e
@ -2777,10 +2777,6 @@ virStorageBackendBLKIDFindEmpty(const char *device,
|
|||||||
rc == VIR_STORAGE_BLKID_PROBE_UNKNOWN) {
|
rc == VIR_STORAGE_BLKID_PROBE_UNKNOWN) {
|
||||||
|
|
||||||
rc = virStorageBackendBLKIDFindPart(probe, device, format);
|
rc = virStorageBackendBLKIDFindPart(probe, device, format);
|
||||||
if (rc == VIR_STORAGE_BLKID_PROBE_UNKNOWN) {
|
|
||||||
ret = -2;
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (rc) {
|
switch (rc) {
|
||||||
@ -2799,10 +2795,7 @@ virStorageBackendBLKIDFindEmpty(const char *device,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_STORAGE_BLKID_PROBE_UNKNOWN:
|
case VIR_STORAGE_BLKID_PROBE_UNKNOWN:
|
||||||
virReportError(VIR_ERR_STORAGE_PROBE_FAILED,
|
ret = -2;
|
||||||
_("Not capable of probing for format type '%s', "
|
|
||||||
"requires build --overwrite"),
|
|
||||||
format);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_STORAGE_BLKID_PROBE_MATCH:
|
case VIR_STORAGE_BLKID_PROBE_MATCH:
|
||||||
@ -2829,7 +2822,6 @@ virStorageBackendBLKIDFindEmpty(const char *device,
|
|||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
|
||||||
blkid_free_probe(probe);
|
blkid_free_probe(probe);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user