On Mon, 24 Sep 2018 14:40:24 +0200 David Hildenbrand <da...@redhat.com> wrote:
> On 24/09/2018 14:39, Igor Mammedov wrote: > > On Mon, 24 Sep 2018 14:26:23 +0200 > > David Hildenbrand <da...@redhat.com> wrote: > > > >> On 24/09/2018 14:22, Igor Mammedov wrote: > >>> On Thu, 20 Sep 2018 12:32:27 +0200 > >>> David Hildenbrand <da...@redhat.com> wrote: > >>> > >>>> Document the functions and when to not expect errors. > >>>> > >>>> Signed-off-by: David Hildenbrand <da...@redhat.com> > >>>> --- > >>>> include/hw/mem/memory-device.h | 13 +++++++++++++ > >>>> 1 file changed, 13 insertions(+) > >>>> > >>>> diff --git a/include/hw/mem/memory-device.h > >>>> b/include/hw/mem/memory-device.h > >>> [...] > >>> > >>>> + * @get_plugged_size: The amount of memory provided by this @md > >>>> currently > >>>> + * usable ("plugged") by the guest. > >>>> + * @get_region_size: The size of the memory region of the @md that's > >>>> mapped > >>>> + * in guest physical memory at @get_addr > >>> Tried to read it several times, > >>> but still description of hooks makes them look like they are doing the > >>> same thing, > >>> so what's the difference? > >> > >> That's a preparation mainly for virtio-mem, where we manage the amount > >> of memory that is actually accessible and visible by the guest (plugged) > >> inside a memory region dynamically. The difference exists purely for > >> stats. (could have been introduced later, but it made sense to split > >> this off right when factoring this stuff out into memory-device code). > > Purpose might be obvious (for you) right now, but later when reader > > would be reading history it's confusing. > > I'd postpone it until there is an actual user for it. > > > > What to postpone? The doc update? get_plugged_size is already upstream. We can't do anything to merged stuff (unless one would remove it :/), but doc update as is, just adding more confusion. Alternatively clarify distinction referring to future devices that might return different values for both hooks.