mirror of https://gitee.com/openkylin/libvirt.git
qemuDomainDetermineDiskChain: Remove 'report_broken' argument
All callers pass 'true'. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
5eb283e294
commit
942da2d661
|
@ -7532,19 +7532,16 @@ qemuDomainPrepareStorageSourceConfig(virStorageSource *src,
|
||||||
* @vm: domain object
|
* @vm: domain object
|
||||||
* @disk: disk definition
|
* @disk: disk definition
|
||||||
* @disksrc: source to determine the chain for, may be NULL
|
* @disksrc: source to determine the chain for, may be NULL
|
||||||
* @report_broken: report broken chain verbosely
|
|
||||||
*
|
*
|
||||||
* Prepares and initializes the backing chain of disk @disk. In cases where
|
* Prepares and initializes the backing chain of disk @disk. In cases where
|
||||||
* a new source is to be associated with @disk the @disksrc parameter can be
|
* a new source is to be associated with @disk the @disksrc parameter can be
|
||||||
* used to override the source. If @report_broken is true missing images
|
* used to override the source.
|
||||||
* in the backing chain are reported.
|
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
qemuDomainDetermineDiskChain(virQEMUDriver *driver,
|
qemuDomainDetermineDiskChain(virQEMUDriver *driver,
|
||||||
virDomainObj *vm,
|
virDomainObj *vm,
|
||||||
virDomainDiskDef *disk,
|
virDomainDiskDef *disk,
|
||||||
virStorageSource *disksrc,
|
virStorageSource *disksrc)
|
||||||
bool report_broken)
|
|
||||||
{
|
{
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
||||||
virStorageSource *src; /* iterator for the backing chain declared in XML */
|
virStorageSource *src; /* iterator for the backing chain declared in XML */
|
||||||
|
@ -7566,8 +7563,7 @@ qemuDomainDetermineDiskChain(virQEMUDriver *driver,
|
||||||
disksrc->format < VIR_STORAGE_FILE_BACKING) {
|
disksrc->format < VIR_STORAGE_FILE_BACKING) {
|
||||||
|
|
||||||
if (!virFileExists(disksrc->path)) {
|
if (!virFileExists(disksrc->path)) {
|
||||||
if (report_broken)
|
virStorageSourceReportBrokenChain(errno, disksrc, disksrc);
|
||||||
virStorageSourceReportBrokenChain(errno, disksrc, disksrc);
|
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -7590,24 +7586,22 @@ qemuDomainDetermineDiskChain(virQEMUDriver *driver,
|
||||||
src = disksrc;
|
src = disksrc;
|
||||||
/* skip to the end of the chain if there is any */
|
/* skip to the end of the chain if there is any */
|
||||||
while (virStorageSourceHasBacking(src)) {
|
while (virStorageSourceHasBacking(src)) {
|
||||||
if (report_broken) {
|
int rv = virStorageSourceSupportsAccess(src);
|
||||||
int rv = virStorageSourceSupportsAccess(src);
|
|
||||||
|
|
||||||
if (rv < 0)
|
if (rv < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (rv > 0) {
|
||||||
|
if (qemuDomainStorageFileInit(driver, vm, src, disksrc) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (rv > 0) {
|
if (virStorageSourceAccess(src, F_OK) < 0) {
|
||||||
if (qemuDomainStorageFileInit(driver, vm, src, disksrc) < 0)
|
virStorageSourceReportBrokenChain(errno, src, disksrc);
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (virStorageSourceAccess(src, F_OK) < 0) {
|
|
||||||
virStorageSourceReportBrokenChain(errno, src, disksrc);
|
|
||||||
virStorageSourceDeinit(src);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
virStorageSourceDeinit(src);
|
virStorageSourceDeinit(src);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virStorageSourceDeinit(src);
|
||||||
}
|
}
|
||||||
src = src->backingStore;
|
src = src->backingStore;
|
||||||
}
|
}
|
||||||
|
@ -7625,7 +7619,7 @@ qemuDomainDetermineDiskChain(virQEMUDriver *driver,
|
||||||
|
|
||||||
if (virStorageSourceGetMetadata(src, uid, gid,
|
if (virStorageSourceGetMetadata(src, uid, gid,
|
||||||
QEMU_DOMAIN_STORAGE_SOURCE_CHAIN_MAX_DEPTH,
|
QEMU_DOMAIN_STORAGE_SOURCE_CHAIN_MAX_DEPTH,
|
||||||
report_broken) < 0)
|
true) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
for (n = src->backingStore; virStorageSourceIsBacking(n); n = n->backingStore) {
|
for (n = src->backingStore; virStorageSourceIsBacking(n); n = n->backingStore) {
|
||||||
|
|
|
@ -708,8 +708,7 @@ int qemuDomainStorageSourceValidateDepth(virStorageSource *src,
|
||||||
int qemuDomainDetermineDiskChain(virQEMUDriver *driver,
|
int qemuDomainDetermineDiskChain(virQEMUDriver *driver,
|
||||||
virDomainObj *vm,
|
virDomainObj *vm,
|
||||||
virDomainDiskDef *disk,
|
virDomainDiskDef *disk,
|
||||||
virStorageSource *disksrc,
|
virStorageSource *disksrc);
|
||||||
bool report_broken);
|
|
||||||
|
|
||||||
bool qemuDomainDiskChangeSupported(virDomainDiskDef *disk,
|
bool qemuDomainDiskChangeSupported(virDomainDiskDef *disk,
|
||||||
virDomainDiskDef *orig_disk);
|
virDomainDiskDef *orig_disk);
|
||||||
|
|
|
@ -15084,7 +15084,7 @@ qemuDomainBlockCopyCommon(virDomainObj *vm,
|
||||||
if (mirror_reuse &&
|
if (mirror_reuse &&
|
||||||
mirror->format >= VIR_STORAGE_FILE_BACKING &&
|
mirror->format >= VIR_STORAGE_FILE_BACKING &&
|
||||||
mirror->backingStore == NULL &&
|
mirror->backingStore == NULL &&
|
||||||
qemuDomainDetermineDiskChain(driver, vm, disk, mirror, true) < 0)
|
qemuDomainDetermineDiskChain(driver, vm, disk, mirror) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
if (qemuDomainStorageSourceChainAccessAllow(driver, vm, mirror) < 0)
|
if (qemuDomainStorageSourceChainAccessAllow(driver, vm, mirror) < 0)
|
||||||
|
|
|
@ -571,7 +571,7 @@ qemuDomainChangeEjectableMedia(virQEMUDriver *driver,
|
||||||
if (virDomainDiskTranslateSourcePool(disk) < 0)
|
if (virDomainDiskTranslateSourcePool(disk) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (qemuDomainDetermineDiskChain(driver, vm, disk, NULL, true) < 0)
|
if (qemuDomainDetermineDiskChain(driver, vm, disk, NULL) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (qemuDomainPrepareDiskSource(disk, priv, cfg) < 0)
|
if (qemuDomainPrepareDiskSource(disk, priv, cfg) < 0)
|
||||||
|
@ -902,7 +902,7 @@ qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriver *driver,
|
||||||
if (virDomainDiskTranslateSourcePool(disk) < 0)
|
if (virDomainDiskTranslateSourcePool(disk) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (qemuDomainDetermineDiskChain(driver, vm, disk, NULL, true) < 0)
|
if (qemuDomainDetermineDiskChain(driver, vm, disk, NULL) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
for (i = 0; i < vm->def->ndisks; i++) {
|
for (i = 0; i < vm->def->ndisks; i++) {
|
||||||
|
|
|
@ -6774,7 +6774,7 @@ qemuProcessPrepareHostStorage(virQEMUDriver *driver,
|
||||||
if (qemuDomainDiskIsMissingLocalOptional(disk) && cold_boot)
|
if (qemuDomainDiskIsMissingLocalOptional(disk) && cold_boot)
|
||||||
VIR_INFO("optional disk '%s' source file is missing, "
|
VIR_INFO("optional disk '%s' source file is missing, "
|
||||||
"skip checking disk chain", disk->dst);
|
"skip checking disk chain", disk->dst);
|
||||||
else if (qemuDomainDetermineDiskChain(driver, vm, disk, NULL, true) >= 0)
|
else if (qemuDomainDetermineDiskChain(driver, vm, disk, NULL) >= 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (qemuDomainCheckDiskStartupPolicy(driver, vm, idx, cold_boot) >= 0)
|
if (qemuDomainCheckDiskStartupPolicy(driver, vm, idx, cold_boot) >= 0)
|
||||||
|
|
Loading…
Reference in New Issue