mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 06:35:24 +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. */
|
/* Double check requested disks. */
|
||||||
for (i = 0; i < chkdef->ndisks; i++) {
|
for (i = 0; i < chkdef->ndisks; i++) {
|
||||||
virDomainCheckpointDiskDefPtr chkdisk = &chkdef->disks[i];
|
virDomainCheckpointDiskDefPtr chkdisk = &chkdef->disks[i];
|
||||||
int idx = virDomainDiskIndexByName(domdef, chkdisk->name, false);
|
virDomainDiskDefPtr domdisk = virDomainDiskByName(domdef, chkdisk->name, false);
|
||||||
virDomainDiskDefPtr domdisk;
|
|
||||||
|
|
||||||
if (idx < 0) {
|
if (!domdisk) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("no disk named '%s'"), chkdisk->name);
|
_("no disk named '%s'"), chkdisk->name);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
domdisk = domdef->disks[idx];
|
|
||||||
|
|
||||||
if (virHashHasEntry(map, domdisk->dst)) {
|
if (virHashHasEntry(map, domdisk->dst)) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("disk '%s' specified twice"),
|
_("disk '%s' specified twice"),
|
||||||
|
Loading…
Reference in New Issue
Block a user