[PATCH 06/10] conf: virDomainSnapshotAlignDisks: use convinient variable

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

 



Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@xxxxxxxxxxxxx>
---
 src/conf/snapshot_conf.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c
index 2a35b25..002cd45 100644
--- a/src/conf/snapshot_conf.c
+++ b/src/conf/snapshot_conf.c
@@ -560,6 +560,7 @@ virDomainSnapshotAlignDisks(virDomainSnapshotDefPtr def,
     /* Double check requested disks.  */
     for (i = 0; i < def->ndisks; i++) {
         virDomainSnapshotDiskDefPtr disk = &def->disks[i];
+        virDomainDiskDefPtr dom_disk;
         int idx = virDomainDiskIndexByName(def->dom, disk->name, false);
         int disk_snapshot;
 
@@ -577,17 +578,18 @@ virDomainSnapshotAlignDisks(virDomainSnapshotDefPtr def,
         }
         ignore_value(virBitmapSetBit(map, idx));
         disk->idx = idx;
+        dom_disk = def->dom->disks[idx];
 
-        disk_snapshot = def->dom->disks[idx]->snapshot;
+        disk_snapshot = dom_disk->snapshot;
         if (!disk->snapshot) {
             if (disk_snapshot)
                 disk->snapshot = disk_snapshot;
             else
                 disk->snapshot = default_snapshot;
         }
-        if (STRNEQ(disk->name, def->dom->disks[idx]->dst)) {
+        if (STRNEQ(disk->name, dom_disk->dst)) {
             VIR_FREE(disk->name);
-            if (VIR_STRDUP(disk->name, def->dom->disks[idx]->dst) < 0)
+            if (VIR_STRDUP(disk->name, dom_disk->dst) < 0)
                 goto cleanup;
         }
     }
-- 
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