1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-30 18:50:18 +03:00

conf: Don't call 'virDomainDiskDefAssignAddress' when disk->dst is NULL

The code rejecting a XML when the disk target is missing was moved to
the validation code which goes after post parse. One of the cases in the
disk post parse code didn't check whether 'disk->dst' is set which at
that point isn't guaranteed.

Fixes: 61fd7174c2afbe128ef1896198919429bcaca3d7
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2001627
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2021-09-07 09:22:42 +02:00
parent 002de683c6
commit cf6b34c683

View File

@ -5413,6 +5413,7 @@ virDomainDiskDefPostParse(virDomainDiskDef *disk,
}
if (disk->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
disk->dst &&
virDomainDiskDefAssignAddress(xmlopt, disk, def) < 0) {
return -1;
}