Re: [libvirt PATCH v6 13/30] nodedev: handle mdevs that disappear from mdevctl

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

 



On Fri, Mar 26, 2021 at 11:48:09AM -0500, Jonathon Jongsma wrote:
> mdevctl does not currently provide any events when the list of defined
> devices changes, so we will need to poll mdevctl for the list of defined
> devices periodically. When a mediated device no longer exists from one
> iteration to the next, we need to treat it as an "undefine" event.
> 
> When we get such an event, we remove the device from the list if it's
> not active. Otherwise, we simply mark it as non-persistent.
> 
> Signed-off-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx>
> ---
>  src/node_device/node_device_driver.c | 67 ++++++++++++++++++++++++++--
>  1 file changed, 64 insertions(+), 3 deletions(-)
> 
> diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
> index efa524f317..4be650ddef 100644
> --- a/src/node_device/node_device_driver.c
> +++ b/src/node_device/node_device_driver.c
> @@ -1183,20 +1183,81 @@ virMdevctlListDefined(virNodeDeviceDef ***devs)
>  }
>  
>  
> +typedef struct _virMdevctlForEachData virMdevctlForEachData;
> +struct _virMdevctlForEachData {
> +    int ndefs;
> +    virNodeDeviceDef **defs;
> +};
> +
> +
> +/* This function keeps the list of persistent mediated devices consistent
> + * between the nodedev driver and mdevctl.
> + * @obj is a device that is currently known by the nodedev driver, and @opaque
> + * contains the most recent list of devices defined by mdevctl. If @obj is no
> + * longer defined in mdevctl, mark it as undefined and possibly remove it from
> + * the driver as well. Returning 'true' from this function indicates that the
> + * device should be removed from the nodedev driver list. */
> +static bool
> +removeMissingPersistentMdevs(virNodeDeviceObj *obj,

Since this handles a single device at a time --> removeMissingPersistentMdev

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