Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
vhost-user-blk: add vhost-user-blk-pci host device to Qemu
Add a new vhost-user device type "vhost-user-blk-pci" to
accelerate virtio-blk processing in user space. Qemu uses a
char device to communicate with the I/O processing backend.

The feature is enabled by default with Linux, and depends on
CONFIG_VIRTIO configuration. To use this feature users can
start the qemu with the following command line like this:

qemu-system-x86_64 -m 1024 -object memory-backend-file, \
id=mem,size=1G, mem-path=/dev/hugepages,share=on \
-numa node,memdev=mem -hda /root/ubuntu.img \
-chardev socket,id=char0,path=/path/vhost.0 \
-net user,hostfwd=tcp::10022-:22 -net nic \
-device vhost-user-blk-pci,chardev=char0,\
logical_block_size=512,size=20G \
-vnc 0.0.0.0:1 --enable-kvm

For 'size' parameter, users can specify with G(GiB) or M(MiB).

Change-Id: I18b7ee930d07c6d9cb051a50398965a37a1c402b
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/363361
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: Daniel Verkamp <daniel.verkamp@intel.com>
  • Loading branch information
changpe1 authored and danielverkamp committed Jun 19, 2017
1 parent 6eed2b5 commit db2fcb0
Show file tree
Hide file tree
Showing 6 changed files with 475 additions and 0 deletions.
11 changes: 11 additions & 0 deletions configure
Expand Up @@ -226,6 +226,7 @@ xfs=""

vhost_net="no"
vhost_scsi="no"
vhost_user_blk="no"
vhost_vsock="no"
kvm="no"
hax="no"
Expand Down Expand Up @@ -681,6 +682,7 @@ Haiku)
kvm="yes"
vhost_net="yes"
vhost_scsi="yes"
vhost_user_blk="yes"
vhost_vsock="yes"
QEMU_INCLUDES="-I\$(SRC_PATH)/linux-headers -I$(pwd)/linux-headers $QEMU_INCLUDES"
;;
Expand Down Expand Up @@ -1027,6 +1029,10 @@ for opt do
;;
--enable-vhost-scsi) vhost_scsi="yes"
;;
--disable-vhost-user-blk) vhost_user_blk="no"
;;
--enable-vhost-user-blk) vhost_user_blk="yes"
;;
--disable-vhost-vsock) vhost_vsock="no"
;;
--enable-vhost-vsock) vhost_vsock="yes"
Expand Down Expand Up @@ -1382,6 +1388,7 @@ disabled with --disable-FEATURE, default is enabled if available:
cap-ng libcap-ng support
attr attr and xattr support
vhost-net vhost-net acceleration support
vhost-user-blk VM virtio-blk acceleration in user space
spice spice
rbd rados block device (rbd)
libiscsi iscsi support
Expand Down Expand Up @@ -5076,6 +5083,7 @@ echo "posix_madvise $posix_madvise"
echo "libcap-ng support $cap_ng"
echo "vhost-net support $vhost_net"
echo "vhost-scsi support $vhost_scsi"
echo "vhost-user-blk support $vhost_user_blk"
echo "vhost-vsock support $vhost_vsock"
echo "Trace backends $trace_backends"
if have_backend "simple"; then
Expand Down Expand Up @@ -5464,6 +5472,9 @@ fi
if test "$vhost_scsi" = "yes" ; then
echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak
fi
if test "$vhost_user_blk" = "yes" ; then
echo "CONFIG_VHOST_USER_BLK=y" >> $config_host_mak
fi
if test "$vhost_net" = "yes" ; then
echo "CONFIG_VHOST_NET_USED=y" >> $config_host_mak
fi
Expand Down
3 changes: 3 additions & 0 deletions hw/block/Makefile.objs
Expand Up @@ -13,3 +13,6 @@ obj-$(CONFIG_SH4) += tc58128.o

obj-$(CONFIG_VIRTIO) += virtio-blk.o
obj-$(CONFIG_VIRTIO) += dataplane/
ifeq ($(CONFIG_VIRTIO),y)
obj-$(CONFIG_VHOST_USER_BLK) += vhost-user-blk.o
endif

0 comments on commit db2fcb0

Please sign in to comment.