From 4df7280bd57e222c2213f548b7acb98980ae0e79 Mon Sep 17 00:00:00 2001 From: Yi Li Date: Tue, 7 Apr 2020 20:10:29 +0800 Subject: [PATCH] qemuDomainSnapshotPrepare: use local dom_disk variable Replace vm->def->disks[i] with dom_disk variable which is initialized to the same disk. Signed-off-by: Yi Li Reviewed-by: Pavel Mores Reviewed-by: Michal Privoznik --- src/qemu/qemu_driver.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index e8d47a41cd..31f199fdef 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -14837,14 +14837,13 @@ qemuDomainSnapshotPrepare(virDomainObjPtr vm, active) < 0) return -1; - if (vm->def->disks[i]->src->format > 0 && - vm->def->disks[i]->src->format != VIR_STORAGE_FILE_QCOW2) { + if (dom_disk->src->format > 0 && + dom_disk->src->format != VIR_STORAGE_FILE_QCOW2) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("internal snapshot for disk %s unsupported " "for storage type %s"), disk->name, - virStorageFileFormatTypeToString( - vm->def->disks[i]->src->format)); + virStorageFileFormatTypeToString(dom_disk->src->format)); return -1; } break; -- GitLab