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

[libvirt] [PATCH 3/5] snapshot: Change 'index' to 'idx'



Forthcoming syntax check rule will disallow usage of 'int index', so
change it for snapshot

Signed-off-by: John Ferlan <jferlan redhat com>
---
 src/conf/snapshot_conf.c | 6 +++---
 src/conf/snapshot_conf.h | 2 +-
 src/qemu/qemu_driver.c   | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c
index ca6796a..df19449 100644
--- a/src/conf/snapshot_conf.c
+++ b/src/conf/snapshot_conf.c
@@ -440,7 +440,7 @@ disksorter(const void *a, const void *b)
     const virDomainSnapshotDiskDef *diskb = b;
 
     /* Integer overflow shouldn't be a problem here.  */
-    return diska->index - diskb->index;
+    return diska->idx - diskb->idx;
 }
 
 /* Align def->disks to def->domain.  Sort the list of def->disks,
@@ -500,7 +500,7 @@ virDomainSnapshotAlignDisks(virDomainSnapshotDefPtr def,
             goto cleanup;
         }
         ignore_value(virBitmapSetBit(map, idx));
-        disk->index = idx;
+        disk->idx = idx;
 
         disk_snapshot = def->dom->disks[idx]->snapshot;
         if (!disk->snapshot) {
@@ -553,7 +553,7 @@ virDomainSnapshotAlignDisks(virDomainSnapshotDefPtr def,
             goto cleanup;
         if (VIR_STRDUP(disk->name, def->dom->disks[i]->dst) < 0)
             goto cleanup;
-        disk->index = i;
+        disk->idx = i;
 
         /* Don't snapshot empty drives */
         if (virStorageSourceIsEmpty(def->dom->disks[i]->src))
diff --git a/src/conf/snapshot_conf.h b/src/conf/snapshot_conf.h
index ec3a0ea..167b27f 100644
--- a/src/conf/snapshot_conf.h
+++ b/src/conf/snapshot_conf.h
@@ -49,7 +49,7 @@ typedef struct _virDomainSnapshotDiskDef virDomainSnapshotDiskDef;
 typedef virDomainSnapshotDiskDef *virDomainSnapshotDiskDefPtr;
 struct _virDomainSnapshotDiskDef {
     char *name;     /* name matching the <target dev='...' of the domain */
-    int index;      /* index within snapshot->dom->disks that matches name */
+    int idx;        /* index within snapshot->dom->disks that matches name */
     int snapshot;   /* virDomainSnapshotLocation */
 
     /* details of wrapper external file. src is always non-NULL.
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 3510690..8589681 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -13567,7 +13567,7 @@ qemuDomainSnapshotCreateInactiveExternal(virQEMUDriverPtr driver,
      * create them correctly.  */
     for (i = 0; i < snap->def->ndisks && !reuse; i++) {
         snapdisk = &(snap->def->disks[i]);
-        defdisk = snap->def->dom->disks[snapdisk->index];
+        defdisk = snap->def->dom->disks[snapdisk->idx];
         if (snapdisk->snapshot != VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL)
             continue;
 
@@ -13618,7 +13618,7 @@ qemuDomainSnapshotCreateInactiveExternal(virQEMUDriverPtr driver,
     /* update disk definitions */
     for (i = 0; i < snap->def->ndisks; i++) {
         snapdisk = &(snap->def->disks[i]);
-        defdisk = vm->def->disks[snapdisk->index];
+        defdisk = vm->def->disks[snapdisk->idx];
 
         if (snapdisk->snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL) {
             VIR_FREE(defdisk->src->path);
-- 
2.1.0


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