From owner-svn-src-head@FreeBSD.ORG Tue Feb 26 20:02:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BDC2D36E; Tue, 26 Feb 2013 20:02:17 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B08B41C53; Tue, 26 Feb 2013 20:02:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QK2H29043798; Tue, 26 Feb 2013 20:02:17 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QK2HhZ043797; Tue, 26 Feb 2013 20:02:17 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201302262002.r1QK2HhZ043797@svn.freebsd.org> From: Neel Natu Date: Tue, 26 Feb 2013 20:02:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247342 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2013 20:02:17 -0000 Author: neel Date: Tue Feb 26 20:02:17 2013 New Revision: 247342 URL: http://svnweb.freebsd.org/changeset/base/247342 Log: Ignore the BARRIER flag in the virtio block header. This capability is not advertised by the host so ignore it even if the guest insists on setting the flag. Reviewed by: grehan Obtained from: NetApp Modified: head/usr.sbin/bhyve/pci_virtio_block.c Modified: head/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_block.c Tue Feb 26 20:01:05 2013 (r247341) +++ head/usr.sbin/bhyve/pci_virtio_block.c Tue Feb 26 20:02:17 2013 (r247342) @@ -110,8 +110,9 @@ CTASSERT(sizeof(struct vtblk_config) == * Fixed-size block header */ struct virtio_blk_hdr { -#define VBH_OP_READ 0 -#define VBH_OP_WRITE 1 +#define VBH_OP_READ 0 +#define VBH_OP_WRITE 1 +#define VBH_FLAG_BARRIER 0x80000000 /* OR'ed into vbh_type */ uint32_t vbh_type; uint32_t vbh_ioprio; uint64_t vbh_sector; @@ -198,7 +199,7 @@ pci_vtblk_proc(struct pci_vtblk_softc *s int iolen; int nsegs; int uidx, aidx, didx; - int writeop; + int writeop, type; off_t offset; uidx = *hq->hq_used_idx; @@ -232,7 +233,13 @@ pci_vtblk_proc(struct pci_vtblk_softc *s assert(vid[0].vd_flags & VRING_DESC_F_NEXT); assert((vid[0].vd_flags & VRING_DESC_F_WRITE) == 0); - writeop = (vbh->vbh_type == VBH_OP_WRITE); + /* + * XXX + * The guest should not be setting the BARRIER flag because + * we don't advertise the capability. + */ + type = vbh->vbh_type & ~VBH_FLAG_BARRIER; + writeop = (type == VBH_OP_WRITE); offset = vbh->vbh_sector * DEV_BSIZE;