From: Boris Fiuczynski Date: Thu, 17 Mar 2022 09:48:29 +0000 (+0100) Subject: nodedev: update mdevs on parent change X-Git-Tag: v8.2.0-rc1~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=06aebe8f9a9ca69dfdd84dc36bd5d9c4b52681f0;p=thirdparty%2Flibvirt.git nodedev: update mdevs on parent change 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 Reviewed-by: Michal Privoznik Reviewed-by: Jonathon Jongsma --- diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c index 7b2fb3d953..130c1d4023 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -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; }