aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorJohn Levon <john.levon@nutanix.com>2021-03-22 16:53:15 +0000
committerGitHub <noreply@github.com>2021-03-22 16:53:15 +0000
commit3c33c863a178dbb656c835a000df0defdbaa1a9d (patch)
tree4992aa5da29325bb43f7854a9a75870513566d5f /README.md
parent052d709d0cfd77c36f5b31402c3cc1c3d868d618 (diff)
downloadlibvfio-user-3c33c863a178dbb656c835a000df0defdbaa1a9d.zip
libvfio-user-3c33c863a178dbb656c835a000df0defdbaa1a9d.tar.gz
libvfio-user-3c33c863a178dbb656c835a000df0defdbaa1a9d.tar.bz2
README: fix qemu cmdline (#398)
For the GPIO demo, we were asking qemu to create a file-backed hostmem backend, but neglecting to actually allocate guest RAM from it. While we're here, let's give some clues on how to use hugepages and share memory with libvfio-user. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
Diffstat (limited to 'README.md')
-rw-r--r--README.md13
1 files changed, 7 insertions, 6 deletions
diff --git a/README.md b/README.md
index 4aa87b2..3a990cb 100644
--- a/README.md
+++ b/README.md
@@ -179,12 +179,13 @@ to build the `gpio-pci-idio-16` kernel module yourself - it's part of the
standard Linux kernel, but not usually built and shipped on x86. Start your
guest VM:
- ./x86_64-softmmu/qemu-system-x86_64 -mem-prealloc -m 1024 \
- -object memory-backend-file,id=ram-node0,prealloc=yes,mem-path=mem,share=yes,size=1073741824 \
- -kernel ~/vmlinuz -initrd ~/initrd -nographic \
- -append "console=ttyS0 root=/dev/sda1 single" \
- -hda ~/bionic-server-cloudimg-amd64-0.raw \
- -device vfio-user-pci,socket=/tmp/vfio-user.sock
+ ./x86_64-softmmu/qemu-system-x86_64 -mem-prealloc -m 256 \
+ -object memory-backend-file,id=ram-node0,prealloc=yes,mem-path=/dev/hugepages/gpio,share=yes,size=256M \
+ -numa node,memdev=ram-node0 \
+ -kernel ~/vmlinuz -initrd ~/initrd -nographic \
+ -append "console=ttyS0 root=/dev/sda1 single" \
+ -hda ~/bionic-server-cloudimg-amd64-0.raw \
+ -device vfio-user-pci,socket=/tmp/vfio-user.sock
Log in to your guest VM, and you should be able to load the module and observe
the emulated GPIO device's pins: