diff options
author | Philippe Mathieu-Daudé <philmd@redhat.com> | 2020-09-22 10:38:16 +0200 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2020-10-05 09:35:52 +0100 |
commit | b02c01a513a17e03e2245feff19b3dcc8c408859 (patch) | |
tree | a4bb66de8c0091fc06398ee4dd4e6361759f3733 /block/nvme.c | |
parent | 469e72ab7dbbd7ff4ee601e5ea7c29545d46593b (diff) | |
download | qemu-b02c01a513a17e03e2245feff19b3dcc8c408859.zip |
util/vfio-helpers: Pass page protections to qemu_vfio_pci_map_bar()
Pages are currently mapped READ/WRITE. To be able to use different
protections, add a new argument to qemu_vfio_pci_map_bar().
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20200922083821.578519-2-philmd@redhat.com>
Diffstat (limited to 'block/nvme.c')
-rw-r--r-- | block/nvme.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/block/nvme.c b/block/nvme.c index f4f27b6da7..5a4dc6a722 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -712,7 +712,8 @@ static int nvme_init(BlockDriverState *bs, const char *device, int namespace, goto out; } - s->regs = qemu_vfio_pci_map_bar(s->vfio, 0, 0, NVME_BAR_SIZE, errp); + s->regs = qemu_vfio_pci_map_bar(s->vfio, 0, 0, NVME_BAR_SIZE, + PROT_READ | PROT_WRITE, errp); if (!s->regs) { ret = -EINVAL; goto out; |