Add a new function wrapper and tweak the storage file backend lookup
function so that it can be used without reporting error. This will be
useful in the metadata crawler code where we need silently break if
metadata retrieval is not supported for the current storage type.
virStorageFileBackendPtr
-virStorageFileBackendForType(int type,
- int protocol)
+virStorageFileBackendForTypeInternal(int type,
+ int protocol,
+ bool report)
{
size_t i;
}
}
+ if (!report)
+ return NULL;
+
if (type == VIR_STORAGE_TYPE_NETWORK) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("missing storage backend for network files "
}
+virStorageFileBackendPtr
+virStorageFileBackendForType(int type,
+ int protocol)
+{
+ return virStorageFileBackendForTypeInternal(type, protocol, true);
+}
+
+
struct diskType {
int part_table_type;
unsigned short offset;
int mode);
virStorageFileBackendPtr virStorageFileBackendForType(int type, int protocol);
-
+virStorageFileBackendPtr virStorageFileBackendForTypeInternal(int type,
+ int protocol,
+ bool report);
struct _virStorageFileBackend {