mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 05:17:59 +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:
parent
454e52c89d
commit
29359e99bf
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user