We don't need the index that virDomainDiskIndexByName returns.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/conf/checkpoint_conf.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/conf/checkpoint_conf.c b/src/conf/checkpoint_conf.c
index bd0a673757..089488fbc6 100644
--- a/src/conf/checkpoint_conf.c
+++ b/src/conf/checkpoint_conf.c
@@ -315,17 +315,14 @@ virDomainCheckpointAlignDisks(virDomainCheckpointDefPtr chkdef)
/* Double check requested disks. */
for (i = 0; i < chkdef->ndisks; i++) {
virDomainCheckpointDiskDefPtr chkdisk = &chkdef->disks[i];
- int idx = virDomainDiskIndexByName(domdef, chkdisk->name, false);
- virDomainDiskDefPtr domdisk;
+ virDomainDiskDefPtr domdisk = virDomainDiskByName(domdef, chkdisk->name,
false);
- if (idx < 0) {
+ if (!domdisk) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("no disk named '%s'"), chkdisk->name);
return -1;
}
- domdisk = domdef->disks[idx];
-
if (virHashHasEntry(map, domdisk->dst)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("disk '%s' specified twice"),
--
2.28.0