diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c index ca6796a6b698ea198e9a98ada5559addcfd579e5..df19449b38d6d1897d5079990cac60d57179e812 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 ec3a0ea89ef51af81d44532bba5a87a0f7cfac42..167b27f513c94026c433390ea395d94e0978038d 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 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 9e3fe7b7c619ba5a509c5032ff831a63f9520e93..f5a3ef9af11fec28044025972eeab23020935d5d 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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);