summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé2020-09-22 10:38:16 +0200
committerStefan Hajnoczi2020-10-05 10:35:52 +0200
commitb02c01a513a17e03e2245feff19b3dcc8c408859 (patch)
treea4bb66de8c0091fc06398ee4dd4e6361759f3733 /block
parentMerge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (diff)
downloadqemu-b02c01a513a17e03e2245feff19b3dcc8c408859.tar.gz
qemu-b02c01a513a17e03e2245feff19b3dcc8c408859.tar.xz
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')
-rw-r--r--block/nvme.c3
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;