On Fri, Dec 12, 2025 at 08:33:38PM +0530, Ani Sinha wrote:
> Various subsystems might need to take some steps before the KVM file 
> descriptor
> for a virtual machine is changed. So a new notifier is added to inform them 
> that
> kvm VM file descriptor is about to change.
> 
> Subsequent patches will add callback implementations for specific components
> that need this notification.
> 
> Signed-off-by: Ani Sinha <[email protected]>
> ---
>  accel/kvm/kvm-all.c    | 25 +++++++++++++++++++++++++
>  accel/stubs/kvm-stub.c |  8 ++++++++
>  include/system/kvm.h   | 15 +++++++++++++++
>  3 files changed, 48 insertions(+)
> 
> diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
> index 679cf04375..5b854c9866 100644
> --- a/accel/kvm/kvm-all.c
> +++ b/accel/kvm/kvm-all.c
> @@ -127,6 +127,9 @@ static NotifierList kvm_irqchip_change_notifiers =
>  static NotifierWithReturnList register_vmfd_changed_notifiers =
>      NOTIFIER_WITH_RETURN_LIST_INITIALIZER(register_vmfd_changed_notifiers);
>  
> +static NotifierWithReturnList register_vmfd_pre_change_notifiers =
> +    
> NOTIFIER_WITH_RETURN_LIST_INITIALIZER(register_vmfd_pre_change_notifiers);

I'm wondering whenever it is better to have only one vmfd change
notifier list and pass the callback type (pre/post) as argument?

Less boilerplate.  Also I suspect there is significant overlap between
the users which must do some pre-change cleanups and post-change
re-initialization.

take care,
  Gerd


Reply via email to