]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
nodedev: update mdevs on parent change
authorBoris Fiuczynski <fiuczy@linux.ibm.com>
Thu, 17 Mar 2022 09:48:29 +0000 (10:48 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 17 Mar 2022 10:07:30 +0000 (11:07 +0100)
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@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
src/node_device/node_device_driver.c

index 7b2fb3d953fb3e6f18536b5910beac903d06abde..130c1d4023efe17d4fbed5dd53081410d7c1e05a 100644 (file)
@@ -1669,8 +1669,10 @@ removeMissingPersistentMdev(virNodeDeviceObj *obj,
         return false;
 
     for (i = 0; i < data->ndefs; i++) {
-        /* OK, this mdev is still defined by mdevctl */
-        if (STREQ(data->defs[i]->name, def->name))
+        /* OK, this mdev is still defined by mdevctl
+         * AND the parent object has not changed. */
+        if (STREQ(data->defs[i]->name, def->name) &&
+            STREQ(data->defs[i]->parent, def->parent))
             return false;
     }