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

Michal Privoznik posted 1 patch 11 months ago
Failed in applying to current master (apply log)
src/conf/domain_postparse.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
[PATCH] conf: Run virDomainInputDefPostParse() only for VIR_DOMAIN_DEVICE_INPUT
Posted by Michal Privoznik 11 months ago
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@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
Re: [PATCH] conf: Run virDomainInputDefPostParse() only for VIR_DOMAIN_DEVICE_INPUT
Posted by Ján Tomko 11 months ago
On a Friday in 2023, Michal Privoznik wrote:
>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@redhat.com>
>---
> src/conf/domain_postparse.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano