mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 15:52:55 +00:00
util: virstoragefile: Rename backingMeta to backingStore
To conform with the naming of the planned XML output rename the metadata variable name. s/backingMeta/backingStore/g
This commit is contained in:
parent
4905b983ea
commit
b627b8fd05
@ -18540,9 +18540,9 @@ virDomainDiskDefForeachPath(virDomainDiskDefPtr disk,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
/* XXX: temporarily we need to select the second element of the backing
|
/* XXX: temporarily we need to select the second element of the backing
|
||||||
* chain to start as the first is the copy of the disk itself. */
|
* chain to start as the first is the copy of the disk itself. */
|
||||||
tmp = disk->backingChain ? disk->backingChain->backingMeta : NULL;
|
tmp = disk->backingChain ? disk->backingChain->backingStore : NULL;
|
||||||
while (tmp && virStorageIsFile(tmp->path)) {
|
while (tmp && virStorageIsFile(tmp->path)) {
|
||||||
if (!ignoreOpenFailure && tmp->backingStoreRaw && !tmp->backingMeta) {
|
if (!ignoreOpenFailure && tmp->backingStoreRaw && !tmp->backingStore) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unable to visit backing chain file %s"),
|
_("unable to visit backing chain file %s"),
|
||||||
tmp->backingStoreRaw);
|
tmp->backingStoreRaw);
|
||||||
@ -18550,7 +18550,7 @@ virDomainDiskDefForeachPath(virDomainDiskDefPtr disk,
|
|||||||
}
|
}
|
||||||
if (iter(disk, tmp->path, ++depth, opaque) < 0)
|
if (iter(disk, tmp->path, ++depth, opaque) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
tmp = tmp->backingMeta;
|
tmp = tmp->backingStore;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
@ -15123,7 +15123,7 @@ qemuDomainBlockCopy(virDomainObjPtr vm,
|
|||||||
|
|
||||||
if ((flags & VIR_DOMAIN_BLOCK_REBASE_SHALLOW) &&
|
if ((flags & VIR_DOMAIN_BLOCK_REBASE_SHALLOW) &&
|
||||||
STREQ_NULLABLE(format, "raw") &&
|
STREQ_NULLABLE(format, "raw") &&
|
||||||
disk->backingChain->backingMeta->path) {
|
disk->backingChain->backingStore->path) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("disk '%s' has backing file, so raw shallow copy "
|
_("disk '%s' has backing file, so raw shallow copy "
|
||||||
"is not possible"),
|
"is not possible"),
|
||||||
@ -15336,14 +15336,14 @@ qemuDomainBlockCommit(virDomainPtr dom, const char *path, const char *base,
|
|||||||
&top_parent))) {
|
&top_parent))) {
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
if (!top_meta || !top_meta->backingMeta) {
|
if (!top_meta || !top_meta->backingStore) {
|
||||||
virReportError(VIR_ERR_INVALID_ARG,
|
virReportError(VIR_ERR_INVALID_ARG,
|
||||||
_("top '%s' in chain for '%s' has no backing file"),
|
_("top '%s' in chain for '%s' has no backing file"),
|
||||||
top_canon, path);
|
top_canon, path);
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
if (!base && (flags & VIR_DOMAIN_BLOCK_COMMIT_SHALLOW))
|
if (!base && (flags & VIR_DOMAIN_BLOCK_COMMIT_SHALLOW))
|
||||||
base_canon = top_meta->backingMeta->path;
|
base_canon = top_meta->backingStore->path;
|
||||||
else if (!(base_canon = virStorageFileChainLookup(top_meta,
|
else if (!(base_canon = virStorageFileChainLookup(top_meta,
|
||||||
base, NULL, NULL)))
|
base, NULL, NULL)))
|
||||||
goto endjob;
|
goto endjob;
|
||||||
@ -15352,7 +15352,7 @@ qemuDomainBlockCommit(virDomainPtr dom, const char *path, const char *base,
|
|||||||
* virStorageFileChainLookup guarantees a simple pointer
|
* virStorageFileChainLookup guarantees a simple pointer
|
||||||
* comparison will work, rather than needing full-blown STREQ. */
|
* comparison will work, rather than needing full-blown STREQ. */
|
||||||
if ((flags & VIR_DOMAIN_BLOCK_COMMIT_SHALLOW) &&
|
if ((flags & VIR_DOMAIN_BLOCK_COMMIT_SHALLOW) &&
|
||||||
base_canon != top_meta->backingMeta->path) {
|
base_canon != top_meta->backingStore->path) {
|
||||||
virReportError(VIR_ERR_INVALID_ARG,
|
virReportError(VIR_ERR_INVALID_ARG,
|
||||||
_("base '%s' is not immediately below '%s' in chain "
|
_("base '%s' is not immediately below '%s' in chain "
|
||||||
"for '%s'"),
|
"for '%s'"),
|
||||||
|
@ -1203,7 +1203,7 @@ virStorageFileGetMetadataRecurse(const char *path, const char *canonPath,
|
|||||||
/* If we failed to get backing data, mark the chain broken */
|
/* If we failed to get backing data, mark the chain broken */
|
||||||
virStorageSourceFree(backing);
|
virStorageSourceFree(backing);
|
||||||
} else {
|
} else {
|
||||||
meta->backingMeta = backing;
|
meta->backingStore = backing;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1297,10 +1297,10 @@ virStorageFileChainGetBroken(virStorageSourcePtr chain,
|
|||||||
if (!chain)
|
if (!chain)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
for (tmp = chain; tmp; tmp = tmp->backingMeta) {
|
for (tmp = chain; tmp; tmp = tmp->backingStore) {
|
||||||
/* Break when we hit end of chain; report error if we detected
|
/* Break when we hit end of chain; report error if we detected
|
||||||
* a missing backing file, infinite loop, or other error */
|
* a missing backing file, infinite loop, or other error */
|
||||||
if (!tmp->backingMeta && tmp->backingStoreRaw) {
|
if (!tmp->backingStore && tmp->backingStoreRaw) {
|
||||||
if (VIR_STRDUP(*brokenFile, tmp->backingStoreRaw) < 0)
|
if (VIR_STRDUP(*brokenFile, tmp->backingStoreRaw) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -1528,7 +1528,7 @@ virStorageFileChainLookup(virStorageSourcePtr chain,
|
|||||||
*parent = NULL;
|
*parent = NULL;
|
||||||
while (chain) {
|
while (chain) {
|
||||||
if (!name) {
|
if (!name) {
|
||||||
if (!chain->backingMeta)
|
if (!chain->backingStore)
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
if (STREQ(name, chain->relPath))
|
if (STREQ(name, chain->relPath))
|
||||||
@ -1545,7 +1545,7 @@ virStorageFileChainLookup(virStorageSourcePtr chain,
|
|||||||
}
|
}
|
||||||
*parent = chain->path;
|
*parent = chain->path;
|
||||||
parentDir = chain->relDir;
|
parentDir = chain->relDir;
|
||||||
chain = chain->backingMeta;
|
chain = chain->backingStore;
|
||||||
}
|
}
|
||||||
if (!chain)
|
if (!chain)
|
||||||
goto error;
|
goto error;
|
||||||
@ -1700,7 +1700,7 @@ virStorageSourceClear(virStorageSourcePtr def)
|
|||||||
VIR_FREE(def->backingStoreRaw);
|
VIR_FREE(def->backingStoreRaw);
|
||||||
|
|
||||||
/* recursively free backing chain */
|
/* recursively free backing chain */
|
||||||
virStorageSourceFree(def->backingMeta);
|
virStorageSourceFree(def->backingStore);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -237,7 +237,7 @@ struct _virStorageSource {
|
|||||||
virSecurityDeviceLabelDefPtr *seclabels;
|
virSecurityDeviceLabelDefPtr *seclabels;
|
||||||
|
|
||||||
/* backing chain of the storage source */
|
/* backing chain of the storage source */
|
||||||
virStorageSourcePtr backingMeta;
|
virStorageSourcePtr backingStore;
|
||||||
|
|
||||||
/* metadata for storage driver access to remote and local volumes */
|
/* metadata for storage driver access to remote and local volumes */
|
||||||
virStorageDriverDataPtr drv;
|
virStorageDriverDataPtr drv;
|
||||||
|
@ -336,7 +336,7 @@ testStorageChain(const void *args)
|
|||||||
virAsprintf(&actual,
|
virAsprintf(&actual,
|
||||||
"store:%s\nraw:%s\nother:%lld %d\n"
|
"store:%s\nraw:%s\nother:%lld %d\n"
|
||||||
"relPath:%s\npath:%s\nrelDir:%s\ntype:%d %d\n",
|
"relPath:%s\npath:%s\nrelDir:%s\ntype:%d %d\n",
|
||||||
NULLSTR(elt->backingMeta ? elt->backingMeta->path : NULL),
|
NULLSTR(elt->backingStore ? elt->backingStore->path : NULL),
|
||||||
NULLSTR(elt->backingStoreRaw),
|
NULLSTR(elt->backingStoreRaw),
|
||||||
elt->capacity, !!elt->encryption,
|
elt->capacity, !!elt->encryption,
|
||||||
NULLSTR(elt->relPath),
|
NULLSTR(elt->relPath),
|
||||||
@ -356,7 +356,7 @@ testStorageChain(const void *args)
|
|||||||
}
|
}
|
||||||
VIR_FREE(expect);
|
VIR_FREE(expect);
|
||||||
VIR_FREE(actual);
|
VIR_FREE(actual);
|
||||||
elt = elt->backingMeta;
|
elt = elt->backingStore;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
if (i != data->nfiles) {
|
if (i != data->nfiles) {
|
||||||
@ -841,16 +841,16 @@ mymain(void)
|
|||||||
TEST_LOOKUP(0, "bogus", NULL, NULL, NULL);
|
TEST_LOOKUP(0, "bogus", NULL, NULL, NULL);
|
||||||
TEST_LOOKUP(1, "wrap", chain->path, chain, NULL);
|
TEST_LOOKUP(1, "wrap", chain->path, chain, NULL);
|
||||||
TEST_LOOKUP(2, abswrap, chain->path, chain, NULL);
|
TEST_LOOKUP(2, abswrap, chain->path, chain, NULL);
|
||||||
TEST_LOOKUP(3, "qcow2", chain->backingMeta->path, chain->backingMeta,
|
TEST_LOOKUP(3, "qcow2", chain->backingStore->path, chain->backingStore,
|
||||||
chain->path);
|
chain->path);
|
||||||
TEST_LOOKUP(4, absqcow2, chain->backingMeta->path, chain->backingMeta,
|
TEST_LOOKUP(4, absqcow2, chain->backingStore->path, chain->backingStore,
|
||||||
chain->path);
|
chain->path);
|
||||||
TEST_LOOKUP(5, "raw", chain->backingMeta->backingMeta->path,
|
TEST_LOOKUP(5, "raw", chain->backingStore->backingStore->path,
|
||||||
chain->backingMeta->backingMeta, chain->backingMeta->path);
|
chain->backingStore->backingStore, chain->backingStore->path);
|
||||||
TEST_LOOKUP(6, absraw, chain->backingMeta->backingMeta->path,
|
TEST_LOOKUP(6, absraw, chain->backingStore->backingStore->path,
|
||||||
chain->backingMeta->backingMeta, chain->backingMeta->path);
|
chain->backingStore->backingStore, chain->backingStore->path);
|
||||||
TEST_LOOKUP(7, NULL, chain->backingMeta->backingMeta->path,
|
TEST_LOOKUP(7, NULL, chain->backingStore->backingStore->path,
|
||||||
chain->backingMeta->backingMeta, chain->backingMeta->path);
|
chain->backingStore->backingStore, chain->backingStore->path);
|
||||||
|
|
||||||
/* Rewrite wrap and qcow2 back to 3-deep chain, relative backing */
|
/* Rewrite wrap and qcow2 back to 3-deep chain, relative backing */
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
@ -877,16 +877,16 @@ mymain(void)
|
|||||||
TEST_LOOKUP(8, "bogus", NULL, NULL, NULL);
|
TEST_LOOKUP(8, "bogus", NULL, NULL, NULL);
|
||||||
TEST_LOOKUP(9, "wrap", chain->path, chain, NULL);
|
TEST_LOOKUP(9, "wrap", chain->path, chain, NULL);
|
||||||
TEST_LOOKUP(10, abswrap, chain->path, chain, NULL);
|
TEST_LOOKUP(10, abswrap, chain->path, chain, NULL);
|
||||||
TEST_LOOKUP(11, "qcow2", chain->backingMeta->path, chain->backingMeta,
|
TEST_LOOKUP(11, "qcow2", chain->backingStore->path, chain->backingStore,
|
||||||
chain->path);
|
chain->path);
|
||||||
TEST_LOOKUP(12, absqcow2, chain->backingMeta->path, chain->backingMeta,
|
TEST_LOOKUP(12, absqcow2, chain->backingStore->path, chain->backingStore,
|
||||||
chain->path);
|
chain->path);
|
||||||
TEST_LOOKUP(13, "raw", chain->backingMeta->backingMeta->path,
|
TEST_LOOKUP(13, "raw", chain->backingStore->backingStore->path,
|
||||||
chain->backingMeta->backingMeta, chain->backingMeta->path);
|
chain->backingStore->backingStore, chain->backingStore->path);
|
||||||
TEST_LOOKUP(14, absraw, chain->backingMeta->backingMeta->path,
|
TEST_LOOKUP(14, absraw, chain->backingStore->backingStore->path,
|
||||||
chain->backingMeta->backingMeta, chain->backingMeta->path);
|
chain->backingStore->backingStore, chain->backingStore->path);
|
||||||
TEST_LOOKUP(15, NULL, chain->backingMeta->backingMeta->path,
|
TEST_LOOKUP(15, NULL, chain->backingStore->backingStore->path,
|
||||||
chain->backingMeta->backingMeta, chain->backingMeta->path);
|
chain->backingStore->backingStore, chain->backingStore->path);
|
||||||
|
|
||||||
/* Use link to wrap with cross-directory relative backing */
|
/* Use link to wrap with cross-directory relative backing */
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
@ -908,17 +908,17 @@ mymain(void)
|
|||||||
TEST_LOOKUP(17, "sub/link2", chain->path, chain, NULL);
|
TEST_LOOKUP(17, "sub/link2", chain->path, chain, NULL);
|
||||||
TEST_LOOKUP(18, "wrap", chain->path, chain, NULL);
|
TEST_LOOKUP(18, "wrap", chain->path, chain, NULL);
|
||||||
TEST_LOOKUP(19, abswrap, chain->path, chain, NULL);
|
TEST_LOOKUP(19, abswrap, chain->path, chain, NULL);
|
||||||
TEST_LOOKUP(20, "../qcow2", chain->backingMeta->path, chain->backingMeta,
|
TEST_LOOKUP(20, "../qcow2", chain->backingStore->path, chain->backingStore,
|
||||||
chain->path);
|
chain->path);
|
||||||
TEST_LOOKUP(21, "qcow2", NULL, NULL, NULL);
|
TEST_LOOKUP(21, "qcow2", NULL, NULL, NULL);
|
||||||
TEST_LOOKUP(22, absqcow2, chain->backingMeta->path, chain->backingMeta,
|
TEST_LOOKUP(22, absqcow2, chain->backingStore->path, chain->backingStore,
|
||||||
chain->path);
|
chain->path);
|
||||||
TEST_LOOKUP(23, "raw", chain->backingMeta->backingMeta->path,
|
TEST_LOOKUP(23, "raw", chain->backingStore->backingStore->path,
|
||||||
chain->backingMeta->backingMeta, chain->backingMeta->path);
|
chain->backingStore->backingStore, chain->backingStore->path);
|
||||||
TEST_LOOKUP(24, absraw, chain->backingMeta->backingMeta->path,
|
TEST_LOOKUP(24, absraw, chain->backingStore->backingStore->path,
|
||||||
chain->backingMeta->backingMeta, chain->backingMeta->path);
|
chain->backingStore->backingStore, chain->backingStore->path);
|
||||||
TEST_LOOKUP(25, NULL, chain->backingMeta->backingMeta->path,
|
TEST_LOOKUP(25, NULL, chain->backingStore->backingStore->path,
|
||||||
chain->backingMeta->backingMeta, chain->backingMeta->path);
|
chain->backingStore->backingStore, chain->backingStore->path);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
/* Final cleanup */
|
/* Final cleanup */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user