mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-30 16:35:24 +00:00
virstoragefile: remove unused virStorageFileChainCheckBroken
The last usage outside of tests was removed by commit <780f8c94ca8b3dee7eb59c1bfbc32f672f965df8>. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
fb04bf28a1
commit
ba9b419910
@ -3127,7 +3127,6 @@ virStorageAuthDefFree;
|
||||
virStorageAuthDefParse;
|
||||
virStorageFileAccess;
|
||||
virStorageFileCanonicalizePath;
|
||||
virStorageFileChainGetBroken;
|
||||
virStorageFileChainLookup;
|
||||
virStorageFileChown;
|
||||
virStorageFileCreate;
|
||||
|
@ -1193,39 +1193,6 @@ virStorageFileGetMetadataFromFD(const char *path,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* virStorageFileChainCheckBroken
|
||||
*
|
||||
* If CHAIN is broken, set *brokenFile to the broken file name,
|
||||
* otherwise set it to NULL. Caller MUST free *brokenFile after use.
|
||||
* Return 0 on success (including when brokenFile is set), negative on
|
||||
* error (allocation failure).
|
||||
*/
|
||||
int
|
||||
virStorageFileChainGetBroken(virStorageSourcePtr chain,
|
||||
char **brokenFile)
|
||||
{
|
||||
virStorageSourcePtr tmp;
|
||||
|
||||
*brokenFile = NULL;
|
||||
|
||||
if (!chain)
|
||||
return 0;
|
||||
|
||||
for (tmp = chain; virStorageSourceIsBacking(tmp); tmp = tmp->backingStore) {
|
||||
/* Break when we hit end of chain; report error if we detected
|
||||
* a missing backing file, infinite loop, or other error */
|
||||
if (!tmp->backingStore && tmp->backingStoreRaw) {
|
||||
*brokenFile = g_strdup(tmp->backingStoreRaw);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* virStorageFileResize:
|
||||
*
|
||||
|
@ -403,9 +403,6 @@ virStorageSourcePtr virStorageFileGetMetadataFromBuf(const char *path,
|
||||
size_t len,
|
||||
int format)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
||||
int virStorageFileChainGetBroken(virStorageSourcePtr chain,
|
||||
char **broken_file);
|
||||
|
||||
int virStorageFileParseChainIndex(const char *diskTarget,
|
||||
const char *name,
|
||||
unsigned int *chainIndex)
|
||||
|
@ -270,7 +270,6 @@ testStorageChain(const void *args)
|
||||
virStorageSourcePtr elt;
|
||||
size_t i = 0;
|
||||
g_autoptr(virStorageSource) meta = NULL;
|
||||
g_autofree char *broken = NULL;
|
||||
|
||||
meta = testStorageFileGetMetadata(data->start, data->format, -1, -1);
|
||||
if (!meta) {
|
||||
@ -289,11 +288,6 @@ testStorageChain(const void *args)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (virStorageFileChainGetBroken(meta, &broken) || broken) {
|
||||
fprintf(stderr, "chain should not be identified as broken\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
elt = meta;
|
||||
while (virStorageSourceIsBacking(elt)) {
|
||||
g_autofree char *expect = NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user