[PATCH 4/6] conf: Don't call 'virDomainDiskDefAssignAddress' when disk->dst is NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 src/conf/domain_conf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index dbefc98ee8..cb9e7218ff 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -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;
     }
-- 
2.31.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux