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:
Peter Krempa 2014-04-17 22:46:18 +02:00
parent 4905b983ea
commit b627b8fd05
5 changed files with 40 additions and 40 deletions

View File

@ -18540,9 +18540,9 @@ virDomainDiskDefForeachPath(virDomainDiskDefPtr disk,
goto cleanup;
/* 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. */
tmp = disk->backingChain ? disk->backingChain->backingMeta : NULL;
tmp = disk->backingChain ? disk->backingChain->backingStore : NULL;
while (tmp && virStorageIsFile(tmp->path)) {
if (!ignoreOpenFailure && tmp->backingStoreRaw && !tmp->backingMeta) {
if (!ignoreOpenFailure && tmp->backingStoreRaw && !tmp->backingStore) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to visit backing chain file %s"),
tmp->backingStoreRaw);
@ -18550,7 +18550,7 @@ virDomainDiskDefForeachPath(virDomainDiskDefPtr disk,
}
if (iter(disk, tmp->path, ++depth, opaque) < 0)
goto cleanup;
tmp = tmp->backingMeta;
tmp = tmp->backingStore;
}
ret = 0;

View File

@ -15123,7 +15123,7 @@ qemuDomainBlockCopy(virDomainObjPtr vm,
if ((flags & VIR_DOMAIN_BLOCK_REBASE_SHALLOW) &&
STREQ_NULLABLE(format, "raw") &&
disk->backingChain->backingMeta->path) {
disk->backingChain->backingStore->path) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("disk '%s' has backing file, so raw shallow copy "
"is not possible"),
@ -15336,14 +15336,14 @@ qemuDomainBlockCommit(virDomainPtr dom, const char *path, const char *base,
&top_parent))) {
goto endjob;
}
if (!top_meta || !top_meta->backingMeta) {
if (!top_meta || !top_meta->backingStore) {
virReportError(VIR_ERR_INVALID_ARG,
_("top '%s' in chain for '%s' has no backing file"),
top_canon, path);
goto endjob;
}
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,
base, NULL, NULL)))
goto endjob;
@ -15352,7 +15352,7 @@ qemuDomainBlockCommit(virDomainPtr dom, const char *path, const char *base,
* virStorageFileChainLookup guarantees a simple pointer
* comparison will work, rather than needing full-blown STREQ. */
if ((flags & VIR_DOMAIN_BLOCK_COMMIT_SHALLOW) &&
base_canon != top_meta->backingMeta->path) {
base_canon != top_meta->backingStore->path) {
virReportError(VIR_ERR_INVALID_ARG,
_("base '%s' is not immediately below '%s' in chain "
"for '%s'"),

View File

@ -1203,7 +1203,7 @@ virStorageFileGetMetadataRecurse(const char *path, const char *canonPath,
/* If we failed to get backing data, mark the chain broken */
virStorageSourceFree(backing);
} else {
meta->backingMeta = backing;
meta->backingStore = backing;
}
}
@ -1297,10 +1297,10 @@ virStorageFileChainGetBroken(virStorageSourcePtr chain,
if (!chain)
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
* 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)
return -1;
@ -1528,7 +1528,7 @@ virStorageFileChainLookup(virStorageSourcePtr chain,
*parent = NULL;
while (chain) {
if (!name) {
if (!chain->backingMeta)
if (!chain->backingStore)
break;
} else {
if (STREQ(name, chain->relPath))
@ -1545,7 +1545,7 @@ virStorageFileChainLookup(virStorageSourcePtr chain,
}
*parent = chain->path;
parentDir = chain->relDir;
chain = chain->backingMeta;
chain = chain->backingStore;
}
if (!chain)
goto error;
@ -1700,7 +1700,7 @@ virStorageSourceClear(virStorageSourcePtr def)
VIR_FREE(def->backingStoreRaw);
/* recursively free backing chain */
virStorageSourceFree(def->backingMeta);
virStorageSourceFree(def->backingStore);
}

View File

@ -237,7 +237,7 @@ struct _virStorageSource {
virSecurityDeviceLabelDefPtr *seclabels;
/* backing chain of the storage source */
virStorageSourcePtr backingMeta;
virStorageSourcePtr backingStore;
/* metadata for storage driver access to remote and local volumes */
virStorageDriverDataPtr drv;

View File

@ -336,7 +336,7 @@ testStorageChain(const void *args)
virAsprintf(&actual,
"store:%s\nraw:%s\nother:%lld %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),
elt->capacity, !!elt->encryption,
NULLSTR(elt->relPath),
@ -356,7 +356,7 @@ testStorageChain(const void *args)
}
VIR_FREE(expect);
VIR_FREE(actual);
elt = elt->backingMeta;
elt = elt->backingStore;
i++;
}
if (i != data->nfiles) {
@ -841,16 +841,16 @@ mymain(void)
TEST_LOOKUP(0, "bogus", NULL, NULL, NULL);
TEST_LOOKUP(1, "wrap", 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);
TEST_LOOKUP(4, absqcow2, chain->backingMeta->path, chain->backingMeta,
TEST_LOOKUP(4, absqcow2, chain->backingStore->path, chain->backingStore,
chain->path);
TEST_LOOKUP(5, "raw", chain->backingMeta->backingMeta->path,
chain->backingMeta->backingMeta, chain->backingMeta->path);
TEST_LOOKUP(6, absraw, chain->backingMeta->backingMeta->path,
chain->backingMeta->backingMeta, chain->backingMeta->path);
TEST_LOOKUP(7, NULL, chain->backingMeta->backingMeta->path,
chain->backingMeta->backingMeta, chain->backingMeta->path);
TEST_LOOKUP(5, "raw", chain->backingStore->backingStore->path,
chain->backingStore->backingStore, chain->backingStore->path);
TEST_LOOKUP(6, absraw, chain->backingStore->backingStore->path,
chain->backingStore->backingStore, chain->backingStore->path);
TEST_LOOKUP(7, NULL, chain->backingStore->backingStore->path,
chain->backingStore->backingStore, chain->backingStore->path);
/* Rewrite wrap and qcow2 back to 3-deep chain, relative backing */
virCommandFree(cmd);
@ -877,16 +877,16 @@ mymain(void)
TEST_LOOKUP(8, "bogus", NULL, NULL, NULL);
TEST_LOOKUP(9, "wrap", 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);
TEST_LOOKUP(12, absqcow2, chain->backingMeta->path, chain->backingMeta,
TEST_LOOKUP(12, absqcow2, chain->backingStore->path, chain->backingStore,
chain->path);
TEST_LOOKUP(13, "raw", chain->backingMeta->backingMeta->path,
chain->backingMeta->backingMeta, chain->backingMeta->path);
TEST_LOOKUP(14, absraw, chain->backingMeta->backingMeta->path,
chain->backingMeta->backingMeta, chain->backingMeta->path);
TEST_LOOKUP(15, NULL, chain->backingMeta->backingMeta->path,
chain->backingMeta->backingMeta, chain->backingMeta->path);
TEST_LOOKUP(13, "raw", chain->backingStore->backingStore->path,
chain->backingStore->backingStore, chain->backingStore->path);
TEST_LOOKUP(14, absraw, chain->backingStore->backingStore->path,
chain->backingStore->backingStore, chain->backingStore->path);
TEST_LOOKUP(15, NULL, chain->backingStore->backingStore->path,
chain->backingStore->backingStore, chain->backingStore->path);
/* Use link to wrap with cross-directory relative backing */
virCommandFree(cmd);
@ -908,17 +908,17 @@ mymain(void)
TEST_LOOKUP(17, "sub/link2", chain->path, chain, NULL);
TEST_LOOKUP(18, "wrap", 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);
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);
TEST_LOOKUP(23, "raw", chain->backingMeta->backingMeta->path,
chain->backingMeta->backingMeta, chain->backingMeta->path);
TEST_LOOKUP(24, absraw, chain->backingMeta->backingMeta->path,
chain->backingMeta->backingMeta, chain->backingMeta->path);
TEST_LOOKUP(25, NULL, chain->backingMeta->backingMeta->path,
chain->backingMeta->backingMeta, chain->backingMeta->path);
TEST_LOOKUP(23, "raw", chain->backingStore->backingStore->path,
chain->backingStore->backingStore, chain->backingStore->path);
TEST_LOOKUP(24, absraw, chain->backingStore->backingStore->path,
chain->backingStore->backingStore, chain->backingStore->path);
TEST_LOOKUP(25, NULL, chain->backingStore->backingStore->path,
chain->backingStore->backingStore, chain->backingStore->path);
cleanup:
/* Final cleanup */