qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 6/8] memory: Sanity check that no listeners rema


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 6/8] memory: Sanity check that no listeners remain on a destroyed AddressSpace
Date: Mon, 13 May 2013 12:10:10 +0100

On 13 May 2013 11:54, David Gibson <address@hidden> wrote:
> At the moment, most AddressSpace objects last as long as the guest system
> in practice, but that could well change in future.  In addition, for VFIO
> we will be introducing some private per-AdressSpace information, which must
> be disposed of before the AddressSpace itself is destroyed.
>
> To reduce the chances of subtle bugs in this area, this patch adds
> asssertions to ensure that when an AddressSpace is destroyed, there are no
> remaining MemoryListeners using that AS as a filter.

Hmm, is this the ideal semantics? Typically the owner of the
MemoryListener isn't the owner of the AddressSpace so it isn't
necessarily in a position to guarantee that it can unregister
the listener before the address space is destroyed. In fact
as the listener API is currently documented, the filter
argument is just an optimisation to save the callbacks having
to filter out irrelevant information themselves.

Perhaps an "address space being destroyed" callback for
listeners would be better? Then VFIO could just do the
necessary disposal operations automatically when the AS
goes away.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]