storageBackendProbeTarget(virStorageSourcePtr target,
virStorageEncryptionPtr *encryption)
{
- int backingStoreFormat;
int rc;
struct stat sb;
g_autoptr(virStorageSource) meta = NULL;
if (!(meta = virStorageFileGetMetadataFromFD(target->path,
fd,
VIR_STORAGE_FILE_AUTO,
- &backingStoreFormat)))
+ NULL)))
return -1;
if (meta->backingStoreRaw) {
if (virStorageSourceNewFromBacking(meta, &target->backingStore) < 0)
return -1;
- target->backingStore->format = backingStoreFormat;
-
/* XXX: Remote storage doesn't play nicely with volumes backed by
* remote storage. To avoid trouble, just fake the backing store is RAW
* and put the string from the metadata as the path of the target. */
backing)) < 0)
return rc;
+ (*backing)->format = parent->backingStoreRawFormat;
(*backing)->readonly = true;
return rc;
}
if (rv == 1)
return 0;
- backingStore->format = src->backingStoreRawFormat;
-
if (backingStore->format == VIR_STORAGE_FILE_AUTO) {
/* Assuming the backing store to be raw can lead to failures. We do
* it only when we must not report an error to prevent losing VMs.