提交 29359e99 编写于 作者: J John Ferlan

snapshot: Change 'index' to 'idx'

Forthcoming syntax check rule will disallow usage of 'int index', so
change it for snapshot
上级 454e52c8
......@@ -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))
......
......@@ -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.
......
......@@ -13571,7 +13571,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;
......@@ -13622,7 +13622,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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册