[PATCH v2 3/4] nodedev: update mdevs on parent change

Boris Fiuczynski fiuczy at linux.ibm.com
Thu Mar 17 09:48:29 UTC 2022


The parent of the mdev definition can change due to the existance of the
parent device. The parents existance can e.g. depend on the device
driver load state.

Signed-off-by: Boris Fiuczynski <fiuczy at linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn at redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma at redhat.com>
---
 src/node_device/node_device_driver.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index 7b2fb3d953..84dde743df 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -1670,7 +1670,9 @@ removeMissingPersistentMdev(virNodeDeviceObj *obj,
 
     for (i = 0; i < data->ndefs; i++) {
         /* OK, this mdev is still defined by mdevctl */
-        if (STREQ(data->defs[i]->name, def->name))
+        /* AND the parent object has not changed */
+        if (STREQ(data->defs[i]->name, def->name) &&
+            STREQ(data->defs[i]->parent, def->parent))
             return false;
     }
 
-- 
2.33.1



More information about the libvir-list mailing list