[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1 02/12] vhost: Return number of free memslots
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v1 02/12] vhost: Return number of free memslots |
Date: |
Wed, 27 Oct 2021 16:11:38 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 |
On 10/27/21 16:04, David Hildenbrand wrote:
> On 27.10.21 15:36, Philippe Mathieu-Daudé wrote:
>> On 10/27/21 14:45, David Hildenbrand wrote:
>>> Let's return the number of free slots instead of only checking if there
>>> is a free slot. Required to support memory devices that consume multiple
>>> memslots.
>>>
>>> Signed-off-by: David Hildenbrand <david@redhat.com>
>>> ---
>>> hw/mem/memory-device.c | 2 +-
>>> hw/virtio/vhost-stub.c | 2 +-
>>> hw/virtio/vhost.c | 4 ++--
>>> include/hw/virtio/vhost.h | 2 +-
>>> 4 files changed, 5 insertions(+), 5 deletions(-)
>>> -bool vhost_has_free_slot(void)
>>> +unsigned int vhost_get_free_memslots(void)
>>> {
>>> return true;
>>
>> return 0;
>
> Oh wait, no. This actually has to be
>
> "return ~0U;" (see real vhost_get_free_memslots())
>
> ... because there is no vhost and consequently no limit applies.
Indeed.
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
- [PATCH v1 00/12] virtio-mem: Expose device memory via multiple memslots, David Hildenbrand, 2021/10/27
- [PATCH v1 01/12] kvm: Return number of free memslots, David Hildenbrand, 2021/10/27
- [PATCH v1 04/12] vhost: Don't merge unmergeable memory sections, David Hildenbrand, 2021/10/27
- [PATCH v1 03/12] memory: Allow for marking memory region aliases unmergeable, David Hildenbrand, 2021/10/27
- [PATCH v1 02/12] vhost: Return number of free memslots, David Hildenbrand, 2021/10/27
- Re: [PATCH v1 02/12] vhost: Return number of free memslots, Philippe Mathieu-Daudé, 2021/10/27
- Re: [PATCH v1 02/12] vhost: Return number of free memslots, David Hildenbrand, 2021/10/27
- Re: [PATCH v1 02/12] vhost: Return number of free memslots, David Hildenbrand, 2021/10/27
- Re: [PATCH v1 02/12] vhost: Return number of free memslots,
Philippe Mathieu-Daudé <=
- Re: [PATCH v1 02/12] vhost: Return number of free memslots, Michael S. Tsirkin, 2021/10/27
- Re: [PATCH v1 02/12] vhost: Return number of free memslots, David Hildenbrand, 2021/10/27
- Re: [PATCH v1 02/12] vhost: Return number of free memslots, Philippe Mathieu-Daudé, 2021/10/27
- Re: [PATCH v1 02/12] vhost: Return number of free memslots, David Hildenbrand, 2021/10/27
[PATCH v1 05/12] memory-device: Move memory_device_check_addable() directly into memory_device_pre_plug(), David Hildenbrand, 2021/10/27
[PATCH v1 06/12] memory-device: Generalize memory_device_used_region_size(), David Hildenbrand, 2021/10/27
[PATCH v1 08/12] vhost: Respect reserved memslots for memory devices when realizing a vhost device, David Hildenbrand, 2021/10/27
[PATCH v1 07/12] memory-device: Support memory devices that dynamically consume multiple memslots, David Hildenbrand, 2021/10/27
[PATCH v1 10/12] virtio-mem: Fix typo in virito_mem_intersect_memory_section() function name, David Hildenbrand, 2021/10/27
[PATCH v1 11/12] virtio-mem: Set the RamDiscardManager for the RAM memory region earlier, David Hildenbrand, 2021/10/27