mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 22:25:25 +00:00
virDomainCheckpointAlignDisks: Use virDomainDiskByName
We don't need the index that virDomainDiskIndexByName returns. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
092e6f2201
commit
22115266b7
@ -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"),
|
||||
|
Loading…
Reference in New Issue
Block a user