[PATCH] conf: Run virDomainInputDefPostParse() only for VIR_DOMAIN_DEVICE_INPUT

Michal Privoznik mprivozn at redhat.com
Fri May 26 14:17:41 UTC 2023


Due to missed break; statement the virDomainInputDefPostParse()
is called not only for VIR_DOMAIN_DEVICE_INPUT but also
VIR_DOMAIN_DEVICE_LEASE and VIR_DOMAIN_DEVICE_NET, which can lead
to all sort of unpredictable results.

Fixes: c4bc4d3b82fbe22e03c986ca896090f481df5c10
Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/conf/domain_postparse.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/conf/domain_postparse.c b/src/conf/domain_postparse.c
index 7ef478e3e1..c6695b460d 100644
--- a/src/conf/domain_postparse.c
+++ b/src/conf/domain_postparse.c
@@ -725,12 +725,13 @@ virDomainDeviceDefPostParseCommon(virDomainDeviceDef *dev,
         ret = virDomainFSDefPostParse(dev->data.fs);
         break;
 
-    case VIR_DOMAIN_DEVICE_LEASE:
-    case VIR_DOMAIN_DEVICE_NET:
     case VIR_DOMAIN_DEVICE_INPUT:
         virDomainInputDefPostParse(dev->data.input, def);
         ret = 0;
         break;
+
+    case VIR_DOMAIN_DEVICE_LEASE:
+    case VIR_DOMAIN_DEVICE_NET:
     case VIR_DOMAIN_DEVICE_SOUND:
     case VIR_DOMAIN_DEVICE_WATCHDOG:
     case VIR_DOMAIN_DEVICE_GRAPHICS:
-- 
2.39.3



More information about the libvir-list mailing list