Re: [PATCH 2/2] hostmem: detect host backend memory is being used properly

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

 




On 13/07/2016 09:30, Igor Mammedov wrote:
> I wonder if it could be cleaner to extend QOM API with
> 
> object_get_refcount();
> 
> and then add
> 
> bool hostmem_is_busy()
> {
>     return object_get_refcount() > 1;
> }
> 
> that would work as not used used hostmem would have ref counter == 1
> and when front-end starts to use it, it calls
>   qdev_prop_allow_set_link_before_realize()
> which rises ref counter of backend to 2.
> 
> Also see a comment below.

I disagree---there are many reasons why a refcount can be > 1, and given
that we use RCU the release of the reference can be delayed arbitrarily.

Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux