1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-11 09:17:52 +03:00

snapshot: Change 'index' to 'idx'

Forthcoming syntax check rule will disallow usage of 'int index', so
change it for snapshot
This commit is contained in:
John Ferlan 2015-04-14 07:35:29 -04:00
parent 454e52c89d
commit 29359e99bf
3 changed files with 6 additions and 6 deletions

View File

@ -440,7 +440,7 @@ disksorter(const void *a, const void *b)
const virDomainSnapshotDiskDef *diskb = b; const virDomainSnapshotDiskDef *diskb = b;
/* Integer overflow shouldn't be a problem here. */ /* 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, /* Align def->disks to def->domain. Sort the list of def->disks,
@ -500,7 +500,7 @@ virDomainSnapshotAlignDisks(virDomainSnapshotDefPtr def,
goto cleanup; goto cleanup;
} }
ignore_value(virBitmapSetBit(map, idx)); ignore_value(virBitmapSetBit(map, idx));
disk->index = idx; disk->idx = idx;
disk_snapshot = def->dom->disks[idx]->snapshot; disk_snapshot = def->dom->disks[idx]->snapshot;
if (!disk->snapshot) { if (!disk->snapshot) {
@ -553,7 +553,7 @@ virDomainSnapshotAlignDisks(virDomainSnapshotDefPtr def,
goto cleanup; goto cleanup;
if (VIR_STRDUP(disk->name, def->dom->disks[i]->dst) < 0) if (VIR_STRDUP(disk->name, def->dom->disks[i]->dst) < 0)
goto cleanup; goto cleanup;
disk->index = i; disk->idx = i;
/* Don't snapshot empty drives */ /* Don't snapshot empty drives */
if (virStorageSourceIsEmpty(def->dom->disks[i]->src)) if (virStorageSourceIsEmpty(def->dom->disks[i]->src))

View File

@ -49,7 +49,7 @@ typedef struct _virDomainSnapshotDiskDef virDomainSnapshotDiskDef;
typedef virDomainSnapshotDiskDef *virDomainSnapshotDiskDefPtr; typedef virDomainSnapshotDiskDef *virDomainSnapshotDiskDefPtr;
struct _virDomainSnapshotDiskDef { struct _virDomainSnapshotDiskDef {
char *name; /* name matching the <target dev='...' of the domain */ 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 */ int snapshot; /* virDomainSnapshotLocation */
/* details of wrapper external file. src is always non-NULL. /* details of wrapper external file. src is always non-NULL.

View File

@ -13571,7 +13571,7 @@ qemuDomainSnapshotCreateInactiveExternal(virQEMUDriverPtr driver,
* create them correctly. */ * create them correctly. */
for (i = 0; i < snap->def->ndisks && !reuse; i++) { for (i = 0; i < snap->def->ndisks && !reuse; i++) {
snapdisk = &(snap->def->disks[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) if (snapdisk->snapshot != VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL)
continue; continue;
@ -13622,7 +13622,7 @@ qemuDomainSnapshotCreateInactiveExternal(virQEMUDriverPtr driver,
/* update disk definitions */ /* update disk definitions */
for (i = 0; i < snap->def->ndisks; i++) { for (i = 0; i < snap->def->ndisks; i++) {
snapdisk = &(snap->def->disks[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) { if (snapdisk->snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL) {
VIR_FREE(defdisk->src->path); VIR_FREE(defdisk->src->path);