Re: [PATCH 4/6] nodedev: Introduce nodeDeviceInitComplete()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 13, 2021 at 12:01:55PM +0200, Michal Privoznik wrote:
> When the device enumeration thread finishes it sets the
> driver->initialized boolean and signals condition to wake up
> other threads that are waiting for the initialization to
> complete. Move this code into a separate function so that it can
> be re-used from other places too.
> 
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
....

> diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
> index 20a13211a0..68547c6986 100644
> --- a/src/node_device/node_device_udev.c
> +++ b/src/node_device/node_device_udev.c
> @@ -1984,10 +1984,7 @@ nodeStateInitializeEnumerate(void *opaque)
>      if (nodeDeviceUpdateMediatedDevices() != 0)
>          goto error;
>  
> -    nodeDeviceLock();
> -    driver->initialized = true;
> -    virCondBroadcast(&driver->initCond);
> -    nodeDeviceUnlock();
> +    nodeDeviceInitComplete();

well, it will be re-used in the same function after patch 5. I suggest going
with the old style - introducing a fallthrough cleanup label and adding a 'goto
cleanup' to the 'error' section. Patch 5 will not be needed in that case.

Erik




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux