qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-discuss] qemu and lio virtio?


From: Mike Lovell
Subject: Re: [Qemu-discuss] qemu and lio virtio?
Date: Tue, 20 May 2014 12:02:19 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 05/20/2014 10:05 AM, Phillip Susi wrote:
I've been reading up on lio / linux scsi target, and they claim to
have a virtio fabric module that implements a virtio disk for the
purpose of kvm-qemu.  This makes no sense to me.  My understanding of
virtio is that qemu implements it in user space to present an
interface to the guest os, where it shows up as a pci device.  This
seems to have nothing whatsoever to do with lio, which seems to be all
about emulating a scsi disk on a non virtual system.

this is actually the combination of a couple pieces. first off, virtio is just a way to send data to and from the guest. there are several things which build components using it such as virtio-net which provides a virtual ethernet interface that passes ethernet frames between the guest and the host. i think you are using the term virtio to refer to virtio-blk (or block) which is a virtual block device. when the guest wants to read a block from the device, it sends some data across virtio to qemu which interprets the command, performs the actual data retrieval, and returns the data to the guest through virtio. that is a very high level simplification of it.

virtio-blk has a few limitations and some of the developers wrote a new virtio based mechanism called virtio-scsi. this uses virtio to present a virtual scsi controller to the guest and the driver for the guest has been in the upstream kernel source for about 2 years. this driver is just the guest side of it.

since the data being passed over virtio is now scsi commands, there needs to be something on the host side to interpret and act on those commands. there are a couple methods for this. the first one that qemu supported was that qemu would do all the work itself and is what would be used for things like qcow2 files. another method is to use the lio scsi target and this is possible because the guest and host are using the scsi command set to communicate. vhost-scsi provides a way for qemu to connect the virtual scsi controller (or initiator in scsi parlance) to the scsi target in the host using the vhost infrastructure. there is actually a third method that i know of which is to the use libiscsi support in qemu to connect the guest to an iscsi target entirely in user-space with no iscsiadm commands required on the host.

unfortunately, it seems that there isn't much documentation around how to use virtio-scsi with vhost-scsi and tcm_vhost. using this requires configuring the lio target and the qemu. the documentation on the lio wiki describes how to configure the target [1]. a while ago, i found a post to lkml that shows some benchmarks but also has a qemu-system-x86_64 command example [2]. it is a couple years old so there might be some details that have changed but it might still work.

hopefully that gives you a better idea of how all of this fits together.

mike

[1] http://linux-iscsi.org/wiki/VHost
[2] https://lkml.org/lkml/2012/8/10/347



reply via email to

[Prev in Thread] Current Thread [Next in Thread]