[PATCH v2 2/2] qemu: don't log error for missing optional storage sources on start

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>
---
 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
+         * 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)
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux