
On 12/13/18 6:02 AM, Nikolay Shirokovskiy wrote:
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> --- src/qemu/qemu_process.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 2f8e19d..d754f09 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6118,7 +6118,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 detemining chain will surely fail
determining
+ * 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);
Perhaps the message here is "less important" (to me at least) than it was for the stats code, but it's also fine as is... with the spelling/typo fixed.. Reviewed-by: John Ferlan <jferlan@redhat.com> John
+ else if (qemuDomainDetermineDiskChain(driver, vm, disk, true) >= 0) continue;
if (qemuDomainCheckDiskStartupPolicy(driver, vm, idx, cold_boot) >= 0)