[PATCH 0/3] vhost-user: warn when guest RAM is not shared

Stefan Hajnoczi posted 3 patches 3 years, 2 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210222161017.570837-1-stefanha@redhat.com
There is a newer version of this series
include/exec/memory.h         | 11 +++++++++++
hw/virtio/vhost-user.c        | 20 ++++++++++++++++----
softmmu/memory.c              |  6 ++++++
tests/qtest/vhost-user-test.c |  2 +-
4 files changed, 34 insertions(+), 5 deletions(-)
[PATCH 0/3] vhost-user: warn when guest RAM is not shared
Posted by Stefan Hajnoczi 3 years, 2 months ago
vhost-user requires -object memory-backend-*,share=on option so that QEMU uses
mmap(MAP_SHARED) on guest RAM that is shared with the vhost-user device backend
process. This is needed so the QEMU process sees changes made by the vhost-user
device backend process, and vice versa.

Today QEMU and the vhost-user device process will start up and then fail with a
confusing error message if the user forgot to specify share=on.

This patch series adds a warning letting the user know that share=on is
required.

Stefan Hajnoczi (3):
  tests/qtest/vhost-user-test: use share=on with memfd
  memory: add memory_region_is_mapped_shared()
  vhost-user: warn when guest RAM is not shared

 include/exec/memory.h         | 11 +++++++++++
 hw/virtio/vhost-user.c        | 20 ++++++++++++++++----
 softmmu/memory.c              |  6 ++++++
 tests/qtest/vhost-user-test.c |  2 +-
 4 files changed, 34 insertions(+), 5 deletions(-)

-- 
2.29.2

Re: [PATCH 0/3] vhost-user: warn when guest RAM is not shared
Posted by Stefan Hajnoczi 3 years ago
On Mon, Feb 22, 2021 at 04:10:14PM +0000, Stefan Hajnoczi wrote:
> vhost-user requires -object memory-backend-*,share=on option so that QEMU uses
> mmap(MAP_SHARED) on guest RAM that is shared with the vhost-user device backend
> process. This is needed so the QEMU process sees changes made by the vhost-user
> device backend process, and vice versa.
> 
> Today QEMU and the vhost-user device process will start up and then fail with a
> confusing error message if the user forgot to specify share=on.
> 
> This patch series adds a warning letting the user know that share=on is
> required.
> 
> Stefan Hajnoczi (3):
>   tests/qtest/vhost-user-test: use share=on with memfd
>   memory: add memory_region_is_mapped_shared()
>   vhost-user: warn when guest RAM is not shared
> 
>  include/exec/memory.h         | 11 +++++++++++
>  hw/virtio/vhost-user.c        | 20 ++++++++++++++++----
>  softmmu/memory.c              |  6 ++++++
>  tests/qtest/vhost-user-test.c |  2 +-
>  4 files changed, 34 insertions(+), 5 deletions(-)

Ping for QEMU 6.1