Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Oct 2014 17:08:54 +0000 (UTC)
From:      Neel Natu <neel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r272710 - head/usr.sbin/bhyve
Message-ID:  <201410071708.s97H8sfT097319@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: neel
Date: Tue Oct  7 17:08:53 2014
New Revision: 272710
URL: https://svnweb.freebsd.org/changeset/base/272710

Log:
  Implement the FLUSH operation in the virtio-block emulation.
  
  This gets rid of the following error message during FreeBSD guest bootup:
  "vtbd0: hard error cmd=flush fsbn 0"
  
  Reported by:	rodrigc
  Reviewed by:	grehan

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 Oct  7 16:46:11 2014	(r272709)
+++ head/usr.sbin/bhyve/pci_virtio_block.c	Tue Oct  7 17:08:53 2014	(r272710)
@@ -94,6 +94,8 @@ struct vtblk_config {
 struct virtio_blk_hdr {
 #define	VBH_OP_READ		0
 #define	VBH_OP_WRITE		1
+#define	VBH_OP_FLUSH		4
+#define	VBH_OP_FLUSH_OUT	5
 #define	VBH_OP_IDENT		8		
 #define	VBH_FLAG_BARRIER	0x80000000	/* OR'ed into vbh_type */
 	uint32_t       	vbh_type;
@@ -217,6 +219,10 @@ pci_vtblk_proc(struct pci_vtblk_softc *s
 		    MIN(iov[1].iov_len, sizeof(sc->vbsc_ident)));
 		err = 0;
 		break;
+	case VBH_OP_FLUSH:
+	case VBH_OP_FLUSH_OUT:
+		err = fsync(sc->vbsc_fd);
+		break;
 	default:
 		err = -ENOSYS;
 		break;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410071708.s97H8sfT097319>