qemu: don't log error for missing optional storage sources on start

Because missing optional storage source is not error. The patch
address only local files. Fixing other cases is a bit ugly.
Below is example of error notice in log now:

error: virStorageFileReportBrokenChain:427 :
   Cannot access storage file '/path/to/missing/optional/disk':
  	No such file or directory

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
This commit is contained in:
Nikolay Shirokovskiy 2018-11-09 14:36:19 +03:00
parent 318d807a0b
commit c541177314

View File

@ -6119,7 +6119,15 @@ qemuProcessPrepareHostStorage(virQEMUDriverPtr driver,
if (!blockdev)
virStorageSourceBackingStoreClear(disk->src);
if (qemuDomainDetermineDiskChain(driver, vm, disk, true) >= 0)
/*
* Go to applying startup policy for optional disk with nonexistent
* source file immediately as determining chain will surely fail
* and we don't want noisy error notice in logs for this case.
*/
if (qemuDomainDiskIsMissingLocalOptional(disk) && cold_boot)
VIR_INFO("optional disk '%s' source file is missing, "
"skip checking disk chain", disk->dst);
else if (qemuDomainDetermineDiskChain(driver, vm, disk, true) >= 0)
continue;
if (qemuDomainCheckDiskStartupPolicy(driver, vm, idx, cold_boot) >= 0)