[libvirt PATCH 7/7] nodedev: look up mdevs by UUID and parent

Michal Prívozník mprivozn at redhat.com
Mon Jul 26 14:47:09 UTC 2021


On 7/23/21 6:40 PM, Jonathon Jongsma wrote:
> Since UUID is not guaranteed to be unique by mdevctl, we may have more
> than one nodedev with the same UUID. Therefore, we need to disambiguate
> when looking up mdevs by specifying the UUID and parent address, which
> mdevctl guarantees to be a unique combination.
> 
> Signed-off-by: Jonathon Jongsma <jjongsma at redhat.com>
> ---
>  src/conf/virnodedeviceobj.c          | 18 ++++++++++++++----
>  src/conf/virnodedeviceobj.h          |  3 ++-
>  src/node_device/node_device_driver.c | 24 ++++++++++++++++--------
>  3 files changed, 32 insertions(+), 13 deletions(-)
> 
> diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c
> index 6e7b354f96..d1d23fc857 100644
> --- a/src/conf/virnodedeviceobj.c
> +++ b/src/conf/virnodedeviceobj.c
> @@ -401,13 +401,20 @@ virNodeDeviceObjListFindSCSIHostByWWNs(virNodeDeviceObjList *devs,
>                                        &data);
>  }
>  
> +
> +typedef struct {
> +    const char *uuid;
> +    const char *parent_addr;
> +} FindMediatedDeviceData;
> +

Again, typedef on one line, struct on the other.

Michal




More information about the libvir-list mailing list