On Fri, Apr 19, 2024 at 02:23 PM -0500, Jonathon Jongsma <jjongsma@xxxxxxxxxx> wrote: > On 4/19/24 9:49 AM, Marc Hartmayer wrote: >> It's better practice for all functions called by the threads to pass the driver >> via parameter and not global variables. Easier to test and cleaner. >> […snip…] >> >> >> static int >> -udevProcessPCI(struct udev_device *device, >> +udevProcessPCI(virNodeDeviceDriverState *driver_state, struct udev_device *device, >> virNodeDeviceDef *def) > > While there are exceptions, the general coding style is to have a single > argument per line for function definitions. Okay. BTW, why is there no .clangformat configuration available for Libvirt? :/ […snip…] >> return 0; >> @@ -1995,15 +1995,15 @@ udevSetupSystemDev(void) >> static void >> nodeStateInitializeEnumerate(void *opaque) >> { >> - struct udev *udev = opaque; >> udevEventData *priv = driver->privateData; >> + struct udev *udev = opaque; > > unnecessary change? Will remove. > >> >> /* Populate with known devices */ >> - if (udevEnumerateDevices(udev) != 0) >> + if (udevEnumerateDevices(driver, udev) != 0) >> goto error; >> /* Load persistent mdevs (which might not be activated yet) and additional >> * information about active mediated devices from mdevctl */ >> - if (nodeDeviceUpdateMediatedDevices() != 0) >> + if (nodeDeviceUpdateMediatedDevices(driver) != 0) >> goto error; >> >> cleanup: >> @@ -2051,9 +2051,11 @@ udevPCITranslateInit(bool privileged G_GNUC_UNUSED) >> >> >> static void >> -mdevctlUpdateThreadFunc(void *opaque G_GNUC_UNUSED) >> +mdevctlUpdateThreadFunc(void *opaque) >> { >> - if (nodeDeviceUpdateMediatedDevices() < 0) >> + virNodeDeviceDriverState *driver_state = opaque; >> + >> + if (nodeDeviceUpdateMediatedDevices(driver_state) < 0) >> VIR_WARN("mdevctl failed to update mediated devices"); >> } >> >> @@ -2070,7 +2072,7 @@ launchMdevctlUpdateThread(int timer G_GNUC_UNUSED, void *opaque) >> } >> >> if (virThreadCreateFull(&thread, false, mdevctlUpdateThreadFunc, >> - "mdevctl-thread", false, NULL) < 0) { >> + "mdevctl-thread", false, driver) < 0) { >> virReportSystemError(errno, "%s", >> _("failed to create mdevctl thread")); >> } > > > > Reviewed-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx> Thanks. > -- Kind regards / Beste Grüße Marc Hartmayer IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Wolfgang Wendt Geschäftsführung: David Faller Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294 _______________________________________________ Devel mailing list -- devel@xxxxxxxxxxxxxxxxx To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx