virStorageSourceClear(&def->src);
VIR_FREE(def->serial);
VIR_FREE(def->dst);
- virStorageSourceFree(def->backingChain);
VIR_FREE(def->mirror);
VIR_FREE(def->wwn);
VIR_FREE(def->vendor);
/* Call iter(disk, name, depth, opaque) for each element of disk and
- * its backing chain in the pre-populated disk->backingChain.
+ * its backing chain in the pre-populated disk->src.backingStore.
* ignoreOpenFailure determines whether to warn about a chain that
* mentions a backing file without also having metadata on that
* file. */
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->backingStore : NULL;
+ tmp = disk->src.backingStore ? disk->src.backingStore->backingStore : NULL;
while (tmp && virStorageIsFile(tmp->path)) {
if (!ignoreOpenFailure && tmp->backingStoreRaw && !tmp->backingStore) {
virReportError(VIR_ERR_INTERNAL_ERROR,
{
char *brokenFile = NULL;
- if (!virDomainDiskGetSource(disk) || !disk->backingChain)
+ if (!virDomainDiskGetSource(disk) || !disk->src.backingStore)
return 0;
- if (virStorageFileChainGetBroken(disk->backingChain, &brokenFile) < 0)
+ if (virStorageFileChainGetBroken(disk->src.backingStore, &brokenFile) < 0)
return -1;
if (brokenFile) {
type == VIR_STORAGE_TYPE_VOLUME)
goto cleanup;
- if (disk->backingChain) {
+ if (disk->src.backingStore) {
if (force) {
- virStorageSourceFree(disk->backingChain);
- disk->backingChain = NULL;
+ virStorageSourceFree(disk->src.backingStore);
+ disk->src.backingStore = NULL;
} else {
goto cleanup;
}
qemuDomainGetImageIds(cfg, vm, disk, &uid, &gid);
- disk->backingChain = virStorageFileGetMetadata(src,
- virDomainDiskGetFormat(disk),
- uid, gid,
- cfg->allowDiskFormatProbing);
- if (!disk->backingChain)
+ disk->src.backingStore = virStorageFileGetMetadata(src,
+ virDomainDiskGetFormat(disk),
+ uid, gid,
+ cfg->allowDiskFormatProbing);
+ if (!disk->src.backingStore)
ret = -1;
cleanup:
* temporarily modify the disk in place. */
char *origsrc = disk->src.path;
int origformat = disk->src.format;
- virStorageSourcePtr origchain = disk->backingChain;
+ virStorageSourcePtr origchain = disk->src.backingStore;
bool origreadonly = disk->readonly;
int ret = -1;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
disk->src.path = (char *) file; /* casting away const is safe here */
disk->src.format = VIR_STORAGE_FILE_RAW;
- disk->backingChain = NULL;
+ disk->src.backingStore = NULL;
disk->readonly = mode == VIR_DISK_CHAIN_READ_ONLY;
if (mode == VIR_DISK_CHAIN_NO_ACCESS) {
cleanup:
disk->src.path = origsrc;
disk->src.format = origformat;
- disk->backingChain = origchain;
+ disk->src.backingStore = origchain;
disk->readonly = origreadonly;
virObjectUnref(cfg);
return ret;
if (virAsprintf(&device, "drive-%s", disk->info.alias) < 0)
goto cleanup;
- /* XXX Here, we know we are about to alter disk->backingChain if
+ /* XXX Here, we know we are about to alter disk->src.backingStore if
* successful, so we nuke the existing chain so that future commands will
* recompute it. Better would be storing the chain ourselves rather than
* reprobing, but this requires modifying domain_conf and our XML to fully
* track the chain across libvirtd restarts. */
- virStorageSourceFree(disk->backingChain);
- disk->backingChain = NULL;
+ virStorageSourceFree(disk->src.backingStore);
+ disk->src.backingStore = NULL;
if (virStorageFileInit(&snap->src) < 0)
goto cleanup;
* we know for sure that there is a backing chain. */
oldsrc = disk->src.path;
oldformat = disk->src.format;
- oldchain = disk->backingChain;
+ oldchain = disk->src.backingStore;
disk->src.path = disk->mirror;
disk->src.format = disk->mirrorFormat;
- disk->backingChain = NULL;
+ disk->src.backingStore = NULL;
if (qemuDomainDetermineDiskChain(driver, vm, disk, false) < 0) {
disk->src.path = oldsrc;
disk->src.format = oldformat;
- disk->backingChain = oldchain;
+ disk->src.backingStore = oldchain;
goto cleanup;
}
if (disk->mirrorFormat && disk->mirrorFormat != VIR_STORAGE_FILE_RAW &&
disk) < 0)) {
disk->src.path = oldsrc;
disk->src.format = oldformat;
- disk->backingChain = oldchain;
+ disk->src.backingStore = oldchain;
goto cleanup;
}
* success case, there's security labeling to worry about. */
disk->src.path = oldsrc;
disk->src.format = oldformat;
- virStorageSourceFree(disk->backingChain);
- disk->backingChain = oldchain;
+ virStorageSourceFree(disk->src.backingStore);
+ disk->src.backingStore = oldchain;
VIR_FREE(disk->mirror);
}
disk->mirrorFormat = VIR_STORAGE_FILE_NONE;
if ((flags & VIR_DOMAIN_BLOCK_REBASE_SHALLOW) &&
STREQ_NULLABLE(format, "raw") &&
- disk->backingChain->backingStore->path) {
+ disk->src.backingStore->backingStore->path) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("disk '%s' has backing file, so raw shallow copy "
"is not possible"),
if (!top) {
top_canon = disk->src.path;
- top_meta = disk->backingChain;
- } else if (!(top_canon = virStorageFileChainLookup(disk->backingChain,
+ top_meta = disk->src.backingStore;
+ } else if (!(top_canon = virStorageFileChainLookup(disk->src.backingStore,
top, &top_meta,
&top_parent))) {
goto endjob;