On 2/13/25 16:39, Max Lamprecht via dev wrote:
> This hook can be used by libaries to restore previous indexes after a
> clear.
> 
> Signed-off-by: Max Lamprecht <[email protected]>
> ---
>  python/ovs/db/idl.py | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py
> index c8cc54346..03efb1a01 100644
> --- a/python/ovs/db/idl.py
> +++ b/python/ovs/db/idl.py
> @@ -790,6 +790,9 @@ class Idl(object):
>          to doing nothing to avoid overhead where it is not needed.
>          """
> 
> +    def after_clear(self):
> +        """Hook that can be used to restore indexes after a clear."""
> +
>      def __clear(self):
>          changed = False
>  
> @@ -802,6 +805,7 @@ class Idl(object):
>  
>          if changed:
>              self.change_seqno += 1
> +            self.after_clear()
>  
>      def __update_has_lock(self, new_has_lock):
>          if new_has_lock and not self.has_lock:
> --
> 2.43.0

Hi, Max.  Thanks for the patch!  Could you please explain in more details
what's the use case for this functionality?  It's not obvious to me why
such a hook is needed.

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to