From owner-freebsd-virtualization@FreeBSD.ORG Tue Jun 19 07:50:12 2012 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2C1A1106564A; Tue, 19 Jun 2012 07:50:12 +0000 (UTC) (envelope-from bryanv@daemoninthecloset.org) Received: from torment.daemoninthecloset.org (torment.daemoninthecloset.org [94.242.209.234]) by mx1.freebsd.org (Postfix) with ESMTP id A16448FC1A; Tue, 19 Jun 2012 07:50:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemoninthecloset.org Received: from sage.daemoninthecloset.org (sage.daemoninthecloset.org [127.0.1.1]) by sage.daemoninthecloset.org (Postfix) with ESMTP id 215E23A8B; Tue, 19 Jun 2012 02:40:44 -0500 (CDT) Date: Tue, 19 Jun 2012 02:40:44 -0500 (CDT) From: Bryan Venteicher To: freebsd-scsi@freebsd.org Message-ID: <1449819169.793.1340091643925.JavaMail.root@sage.daemoninthecloset.org> In-Reply-To: <608701174.2086.1339136958852.JavaMail.root@sage.daemoninthecloset.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.10.20] X-Mailer: Zimbra 7.1.4_GA_2555 (ZimbraWebClient - GC19 ([unknown])/7.1.4_GA_2555) Cc: freebsd-virtualization@freebsd.org Subject: Re: [CFT] VirtIO SCSI Driver X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2012 07:50:12 -0000 Hi, ----- Original Message ----- > From: "Bryan Venteicher" > To: freebsd-scsi@freebsd.org > Cc: freebsd-virtualization@freebsd.org > Sent: Friday, June 8, 2012 1:29:18 AM > Subject: [CFT] VirtIO SCSI Driver > > Hi, > > VirtIO SCSI is a virtualized HBA that offers a couple of advantages > over the existing VirtIO block disk devices. Instead of having a > vtbdX disk, familiar daX and cdX devices are created like from other > SCSI drivers. A single HBA is able to support multiple devices unlike > the VirtIO block where there is one disk per PCI device. And SCSI > devices from the host are able to be passthrough to the guest. > A second patch is available at: www.daemoninthecloset.org/~bryanv/patches/freebsd/freebsd_virtio_scsi_2.patch Most of the changes are just cleanup; the only noteworthy fix is that CAM_SCSI_STATUS_ERROR is now reported correctly. With a QEMU patch provided by the VirtIO SCSI author, bus reset now works. I hope the patch is committed soon upstream to QEMU. As I mentioned in my previous email, you need a QEMU with VirtIO SCSI support. You can check if your QEMU has the support by: $ qemu -device ? and looking for a line like: name "virtio-scsi-pci", bus PCI VirtIO SCSI should be supported by QEMU 1.1 or later. If your distribution does not provide a new enough QEMU, you'll need to compile from source. You'll then need to have QEMU create a VirtIO SCSI disk for the guest. The CLI sugar to do this is a bit ugly, but will look like: -drive file=/vm_images/vtscsi-2.img,if=none,id=drive-scsi0-0-0 \ -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x6 \ -device scsi-disk,bus=scsi0.0,scsi-id=0,drive=drive-scsi0-0-0,id=scsi0-0-0 AFAIK, this really isn't documented anywhere (the QEMU man page isn't at all helpful) and took a bit of guessing when I was first getting started with it. Bryan > > Should apply cleanly to any recent -current, and probably to a > -stable > with minimal work. >