From owner-svn-src-all@FreeBSD.ORG Tue Sep 9 04:11:55 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA1A8C51; Tue, 9 Sep 2014 04:11:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A947988; Tue, 9 Sep 2014 04:11:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s894Btnn006409; Tue, 9 Sep 2014 04:11:55 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s894BsA8006402; Tue, 9 Sep 2014 04:11:54 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201409090411.s894BsA8006402@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Tue, 9 Sep 2014 04:11:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271299 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Sep 2014 04:11:55 -0000 Author: grehan Date: Tue Sep 9 04:11:54 2014 New Revision: 271299 URL: http://svnweb.freebsd.org/changeset/base/271299 Log: Add a callback to be notified about negotiated features. Submitted by: luigi Obtained from: Vincenzo Maffione, Universita` di Pisa MFC after: 3 days Modified: head/usr.sbin/bhyve/pci_virtio_block.c head/usr.sbin/bhyve/pci_virtio_net.c head/usr.sbin/bhyve/pci_virtio_rnd.c head/usr.sbin/bhyve/virtio.c head/usr.sbin/bhyve/virtio.h Modified: head/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_block.c Tue Sep 9 04:00:30 2014 (r271298) +++ head/usr.sbin/bhyve/pci_virtio_block.c Tue Sep 9 04:11:54 2014 (r271299) @@ -133,6 +133,7 @@ static struct virtio_consts vtblk_vi_con pci_vtblk_notify, /* device-wide qnotify */ pci_vtblk_cfgread, /* read PCI config */ pci_vtblk_cfgwrite, /* write PCI config */ + NULL, /* apply negotiated features */ VTBLK_S_HOSTCAPS, /* our capabilities */ }; Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Tue Sep 9 04:00:30 2014 (r271298) +++ head/usr.sbin/bhyve/pci_virtio_net.c Tue Sep 9 04:11:54 2014 (r271299) @@ -160,6 +160,7 @@ static struct virtio_consts vtnet_vi_con NULL, /* device-wide qnotify -- not used */ pci_vtnet_cfgread, /* read PCI config */ pci_vtnet_cfgwrite, /* write PCI config */ + NULL, /* apply negotiated features */ VTNET_S_HOSTCAPS, /* our capabilities */ }; Modified: head/usr.sbin/bhyve/pci_virtio_rnd.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_rnd.c Tue Sep 9 04:00:30 2014 (r271298) +++ head/usr.sbin/bhyve/pci_virtio_rnd.c Tue Sep 9 04:11:54 2014 (r271299) @@ -80,6 +80,7 @@ static struct virtio_consts vtrnd_vi_con pci_vtrnd_notify, /* device-wide qnotify */ NULL, /* read virtio config */ NULL, /* write virtio config */ + NULL, /* apply negotiated features */ 0, /* our capabilities */ }; Modified: head/usr.sbin/bhyve/virtio.c ============================================================================== --- head/usr.sbin/bhyve/virtio.c Tue Sep 9 04:00:30 2014 (r271298) +++ head/usr.sbin/bhyve/virtio.c Tue Sep 9 04:11:54 2014 (r271299) @@ -698,6 +698,9 @@ bad: switch (offset) { case VTCFG_R_GUESTCAP: vs->vs_negotiated_caps = value & vc->vc_hv_caps; + if (vc->vc_apply_features) + (*vc->vc_apply_features)(DEV_SOFTC(vs), + vs->vs_negotiated_caps); break; case VTCFG_R_PFN: if (vs->vs_curq >= vc->vc_nvq) Modified: head/usr.sbin/bhyve/virtio.h ============================================================================== --- head/usr.sbin/bhyve/virtio.h Tue Sep 9 04:00:30 2014 (r271298) +++ head/usr.sbin/bhyve/virtio.h Tue Sep 9 04:11:54 2014 (r271299) @@ -352,6 +352,8 @@ struct virtio_consts { /* called to read config regs */ int (*vc_cfgwrite)(void *, int, int, uint32_t); /* called to write config regs */ + void (*vc_apply_features)(void *, uint64_t); + /* called to apply negotiated features */ uint64_t vc_hv_caps; /* hypervisor-provided capabilities */ };