Rather than special casing the VIR_STORAGE_BLKID_PROBE_UNKNOWN after
calling virStorageBackendBLKIDFindPart, just allow the switch statement
handle setting ret = -2.
rc == VIR_STORAGE_BLKID_PROBE_UNKNOWN) {
rc = virStorageBackendBLKIDFindPart(probe, device, format);
- if (rc == VIR_STORAGE_BLKID_PROBE_UNKNOWN) {
- ret = -2;
- goto cleanup;
- }
}
switch (rc) {
break;
case VIR_STORAGE_BLKID_PROBE_UNKNOWN:
- virReportError(VIR_ERR_STORAGE_PROBE_FAILED,
- _("Not capable of probing for format type '%s', "
- "requires build --overwrite"),
- format);
+ ret = -2;
break;
case VIR_STORAGE_BLKID_PROBE_MATCH:
ret = -1;
}
- cleanup:
blkid_free_probe(probe);
return ret;