[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: QEMU device refcounting when device creates a container MR
From: |
Peter Xu |
Subject: |
Re: QEMU device refcounting when device creates a container MR |
Date: |
Fri, 11 Mar 2022 10:19:52 +0800 |
On Thu, Mar 10, 2022 at 01:45:31PM +0000, Peter Maydell wrote:
> The other theory I had was "maybe if you put an MR into another
> MR and they both have the same owner then don't bump the refcount"
> but I haven't thought that through at all.
Maybe it'll work, it just sounds a bit more tricky.
>
> > That means, perhaps in object_init_with_type() we should make sure the
> > object refcount==1 after the ->instance_init() call?
>
> That's probably a useful invariant, which I bet we don't
> currently get right for every object :-)
Yeah same feeling.. :)
We could have looped over each device and try creating them and fix one by
one? But I think that doesn't cover all the cases, because instance_init()
could have some sub-regions conditionally added depending on the device
parameters and so on, so they may not be covered by the default values
being tested with.
--
Peter Xu
- QEMU device refcounting when device creates a container MR, Peter Maydell, 2022/03/09
- Re: QEMU device refcounting when device creates a container MR, Paolo Bonzini, 2022/03/09
- Re: QEMU device refcounting when device creates a container MR, Peter Maydell, 2022/03/09
- Re: QEMU device refcounting when device creates a container MR, Peter Maydell, 2022/03/09
- Re: QEMU device refcounting when device creates a container MR, Igor Mammedov, 2022/03/10
- Re: QEMU device refcounting when device creates a container MR, Peter Maydell, 2022/03/10
- Re: QEMU device refcounting when device creates a container MR, Igor Mammedov, 2022/03/10
- Re: QEMU device refcounting when device creates a container MR, Peter Maydell, 2022/03/10
- Re: QEMU device refcounting when device creates a container MR, Igor Mammedov, 2022/03/18