/**
* qemuBlockGetBackingStoreString:
* @src: storage source to get the string for
+ * @pretty: pretty-print the JSON (if applicable, used by tests)
*
* Formats a string used in the backing store field of a disk image which
* supports backing store. Non-local storage may result in use of the json:
* pseudo protocol for any complex configuration.
*/
char *
-qemuBlockGetBackingStoreString(virStorageSourcePtr src)
+qemuBlockGetBackingStoreString(virStorageSourcePtr src,
+ bool pretty)
{
int actualType = virStorageSourceGetActualType(src);
g_autoptr(virJSONValue) backingProps = NULL;
props = sliceProps;
}
- if (!(backingJSON = virJSONValueToString(props, false)))
+ if (!(backingJSON = virJSONValueToString(props, pretty)))
return NULL;
ret = g_strdup_printf("json:%s", backingJSON);
backingFormatStr = virStorageFileFormatTypeToString(backing->format);
}
- if (!(backingFileStr = qemuBlockGetBackingStoreString(backing)))
+ if (!(backingFileStr = qemuBlockGetBackingStoreString(backing, false)))
return -1;
if (virJSONValueObjectAdd(props,
virStorageSourcePtr newsrc);
char *
-qemuBlockGetBackingStoreString(virStorageSourcePtr src)
+qemuBlockGetBackingStoreString(virStorageSourcePtr src,
+ bool pretty)
ATTRIBUTE_NONNULL(1);
int
if (baseSource) {
nodebase = baseSource->nodeformat;
if (!backingPath &&
- !(backingPath = qemuBlockGetBackingStoreString(baseSource)))
+ !(backingPath = qemuBlockGetBackingStoreString(baseSource, false)))
goto endjob;
}
device = disk->src->nodeformat;
nodebase = baseSource->nodeformat;
device = qemuDomainDiskGetTopNodename(disk);
if (!backingPath && top_parent &&
- !(backingPath = qemuBlockGetBackingStoreString(baseSource)))
+ !(backingPath = qemuBlockGetBackingStoreString(baseSource, false)))
goto endjob;
if (bitmapDisableActions) {