const char *format ATTRIBUTE_UNUSED,
bool writelabel ATTRIBUTE_UNUSED)
{
- virReportError(VIR_ERR_OPERATION_INVALID, "%s",
- _("probing for filesystems is unsupported "
- "by this build"));
return -2;
}
const char *format ATTRIBUTE_UNUSED,
bool writelabel ATTRIBUTE_UNUSED)
{
- virReportError(VIR_ERR_OPERATION_INVALID, "%s",
- _("PARTED is unsupported by this build"));
- return -1;
+ return -2;
}
+
#endif /* #if WITH_STORAGE_DISK */
* BLKID API if available.
*
* Returns true if the probe deems the device has nothing valid on it
- * and returns false if the probe finds something
+ * or when we cannot check and we're not writing the label.
+ *
+ * Returns false if the probe finds something
*/
bool
virStorageBackendDeviceIsEmpty(const char *devpath,
writelabel)) == -2)
ret = virStorageBackendPARTEDValidLabel(devpath, format, writelabel);
+ if (ret == -2 && !writelabel)
+ ret = 0;
+
+ if (ret == -2) {
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("Unable to probe '%s' for existing data, "
+ "forced overwrite is necessary"),
+ devpath);
+ }
+
return ret == 0;
}