Re: [libvirt PATCH v3 04/11] nodedev: refactor nodeDeviceFindNewDevice()

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

 



On Tue, Jun 16, 2020 at 09:27:52AM -0500, Jonathon Jongsma wrote:
> In preparation for creating mediated devices in libvirt, we will need to
> wait for new mediated devices to be created as well. Refactor
> nodeDeviceFindNewDevice() so that we can re-use the main logic from this
> function to wait for different device types by passing a different
> 'find' function.
>
> Signed-off-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx>
> ---
...
> +
> +static virNodeDevicePtr
> +nodeDeviceFindNewSCSIHostFunc(virConnectPtr conn,
> +                              const void *opaque)
> +{
> +    const NewSCSIHostFuncData *data = opaque;

Technically, there should be an empty line here since ^here we're defining a
variable.

> +    return nodeDeviceLookupSCSIHostByWWN(conn, data->wwnn, data->wwpn, 0);
> +}
> +
> +
> +static virNodeDevicePtr
> +nodeDeviceFindNewSCSIHost(virConnectPtr conn,
> +                          const char *wwnn,
> +                          const char *wwpn)
> +{
> +    NewSCSIHostFuncData data = { .wwnn = wwnn, .wwpn = wwpn};

...same here...

> +    return nodeDeviceFindNewDevice(conn, nodeDeviceFindNewSCSIHostFunc, &data);
> +}

Reviewed-by: Erik Skultety <eskultet@xxxxxxxxxx>




[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