[PATCH 80/80] qemuDomainDetermineDiskChain: Remove 'report_broken' argument

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

 



All callers pass 'true'.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_domain.c  | 36 +++++++++++++++---------------------
 src/qemu/qemu_domain.h  |  3 +--
 src/qemu/qemu_driver.c  |  2 +-
 src/qemu/qemu_hotplug.c |  4 ++--
 src/qemu/qemu_process.c |  2 +-
 5 files changed, 20 insertions(+), 27 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index d372381c74..e227a8b7d4 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -7617,19 +7617,16 @@ qemuDomainPrepareStorageSourceConfig(virStorageSource *src,
  * @vm: domain object
  * @disk: disk definition
  * @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
  * 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
- * in the backing chain are reported.
+ * used to override the source.
  */
 int
 qemuDomainDetermineDiskChain(virQEMUDriver *driver,
                              virDomainObj *vm,
                              virDomainDiskDef *disk,
-                             virStorageSource *disksrc,
-                             bool report_broken)
+                             virStorageSource *disksrc)
 {
     g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
     virStorageSource *src; /* iterator for the backing chain declared in XML */
@@ -7651,8 +7648,7 @@ qemuDomainDetermineDiskChain(virQEMUDriver *driver,
         disksrc->format < VIR_STORAGE_FILE_BACKING) {

         if (!virFileExists(disksrc->path)) {
-            if (report_broken)
-                virStorageSourceReportBrokenChain(errno, disksrc, disksrc);
+            virStorageSourceReportBrokenChain(errno, disksrc, disksrc);

             return -1;
         }
@@ -7675,24 +7671,22 @@ qemuDomainDetermineDiskChain(virQEMUDriver *driver,
     src = disksrc;
     /* skip to the end of the chain if there is any */
     while (virStorageSourceHasBacking(src)) {
-        if (report_broken) {
-            int rv = virStorageSourceSupportsAccess(src);
+        int rv = virStorageSourceSupportsAccess(src);

-            if (rv < 0)
-                return -1;
-
-            if (rv > 0) {
-                if (qemuDomainStorageFileInit(driver, vm, src, disksrc) < 0)
-                    return -1;
+        if (rv < 0)
+            return -1;

-                if (virStorageSourceAccess(src, F_OK) < 0) {
-                    virStorageSourceReportBrokenChain(errno, src, disksrc);
-                    virStorageSourceDeinit(src);
-                    return -1;
-                }
+        if (rv > 0) {
+            if (qemuDomainStorageFileInit(driver, vm, src, disksrc) < 0)
+                return -1;

+            if (virStorageSourceAccess(src, F_OK) < 0) {
+                virStorageSourceReportBrokenChain(errno, src, disksrc);
                 virStorageSourceDeinit(src);
+                return -1;
             }
+
+            virStorageSourceDeinit(src);
         }
         src = src->backingStore;
     }
@@ -7710,7 +7704,7 @@ qemuDomainDetermineDiskChain(virQEMUDriver *driver,

     if (virStorageSourceGetMetadata(src, uid, gid,
                                     QEMU_DOMAIN_STORAGE_SOURCE_CHAIN_MAX_DEPTH,
-                                    report_broken) < 0)
+                                    true) < 0)
         return -1;

     for (n = src->backingStore; virStorageSourceIsBacking(n); n = n->backingStore) {
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index abf245ec2a..dcae0f9601 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -710,8 +710,7 @@ int qemuDomainStorageSourceValidateDepth(virStorageSource *src,
 int qemuDomainDetermineDiskChain(virQEMUDriver *driver,
                                  virDomainObj *vm,
                                  virDomainDiskDef *disk,
-                                 virStorageSource *disksrc,
-                                 bool report_broken);
+                                 virStorageSource *disksrc);

 bool qemuDomainDiskChangeSupported(virDomainDiskDef *disk,
                                    virDomainDiskDef *orig_disk);
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 8c7cb64f98..49f694e0a7 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15141,7 +15141,7 @@ qemuDomainBlockCopyCommon(virDomainObj *vm,
     if (mirror_reuse &&
         mirror->format >= VIR_STORAGE_FILE_BACKING &&
         mirror->backingStore == NULL &&
-        qemuDomainDetermineDiskChain(driver, vm, disk, mirror, true) < 0)
+        qemuDomainDetermineDiskChain(driver, vm, disk, mirror) < 0)
         goto endjob;

     if (qemuDomainStorageSourceChainAccessAllow(driver, vm, mirror) < 0)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index afc9d299f5..72e5b106e9 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -576,7 +576,7 @@ qemuDomainChangeEjectableMedia(virQEMUDriver *driver,
     if (virDomainDiskTranslateSourcePool(disk) < 0)
         goto cleanup;

-    if (qemuDomainDetermineDiskChain(driver, vm, disk, NULL, true) < 0)
+    if (qemuDomainDetermineDiskChain(driver, vm, disk, NULL) < 0)
         goto cleanup;

     if (qemuDomainPrepareDiskSource(disk, priv, cfg) < 0)
@@ -910,7 +910,7 @@ qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriver *driver,
     if (virDomainDiskTranslateSourcePool(disk) < 0)
         goto cleanup;

-    if (qemuDomainDetermineDiskChain(driver, vm, disk, NULL, true) < 0)
+    if (qemuDomainDetermineDiskChain(driver, vm, disk, NULL) < 0)
         goto cleanup;

     for (i = 0; i < vm->def->ndisks; i++) {
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index f15222e932..a596ae8dec 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -6796,7 +6796,7 @@ qemuProcessPrepareHostStorage(virQEMUDriver *driver,
         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, NULL, true) >= 0)
+        else if (qemuDomainDetermineDiskChain(driver, vm, disk, NULL) >= 0)
             continue;

         if (qemuDomainCheckDiskStartupPolicy(driver, vm, idx, cold_boot) >= 0)
-- 
2.36.1




[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