summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorgrehan <grehan@FreeBSD.org>2014-09-09 04:11:54 +0000
committergrehan <grehan@FreeBSD.org>2014-09-09 04:11:54 +0000
commit9571b40fbe9321abd4e31906fb71a0676ea1f83a (patch)
tree906db88903fe0716a545e08b9d9c87314f1d2233 /usr.sbin
parente5ddfb30abb527a21677ab200879826e3224fad1 (diff)
downloadFreeBSD-src-9571b40fbe9321abd4e31906fb71a0676ea1f83a.zip
FreeBSD-src-9571b40fbe9321abd4e31906fb71a0676ea1f83a.tar.gz
Add a callback to be notified about negotiated features.
Submitted by: luigi Obtained from: Vincenzo Maffione, Universita` di Pisa MFC after: 3 days
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bhyve/pci_virtio_block.c1
-rw-r--r--usr.sbin/bhyve/pci_virtio_net.c1
-rw-r--r--usr.sbin/bhyve/pci_virtio_rnd.c1
-rw-r--r--usr.sbin/bhyve/virtio.c3
-rw-r--r--usr.sbin/bhyve/virtio.h2
5 files changed, 8 insertions, 0 deletions
diff --git a/usr.sbin/bhyve/pci_virtio_block.c b/usr.sbin/bhyve/pci_virtio_block.c
index cf1c655..394b116 100644
--- a/usr.sbin/bhyve/pci_virtio_block.c
+++ b/usr.sbin/bhyve/pci_virtio_block.c
@@ -133,6 +133,7 @@ static struct virtio_consts vtblk_vi_consts = {
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 */
};
diff --git a/usr.sbin/bhyve/pci_virtio_net.c b/usr.sbin/bhyve/pci_virtio_net.c
index c3b8690..c9ab972 100644
--- a/usr.sbin/bhyve/pci_virtio_net.c
+++ b/usr.sbin/bhyve/pci_virtio_net.c
@@ -160,6 +160,7 @@ static struct virtio_consts vtnet_vi_consts = {
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 */
};
diff --git a/usr.sbin/bhyve/pci_virtio_rnd.c b/usr.sbin/bhyve/pci_virtio_rnd.c
index 4d53183..0a31080 100644
--- a/usr.sbin/bhyve/pci_virtio_rnd.c
+++ b/usr.sbin/bhyve/pci_virtio_rnd.c
@@ -80,6 +80,7 @@ static struct virtio_consts vtrnd_vi_consts = {
pci_vtrnd_notify, /* device-wide qnotify */
NULL, /* read virtio config */
NULL, /* write virtio config */
+ NULL, /* apply negotiated features */
0, /* our capabilities */
};
diff --git a/usr.sbin/bhyve/virtio.c b/usr.sbin/bhyve/virtio.c
index 2f04b90..19c0d47 100644
--- a/usr.sbin/bhyve/virtio.c
+++ b/usr.sbin/bhyve/virtio.c
@@ -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)
diff --git a/usr.sbin/bhyve/virtio.h b/usr.sbin/bhyve/virtio.h
index 1f29dfa..6f655f3 100644
--- a/usr.sbin/bhyve/virtio.h
+++ b/usr.sbin/bhyve/virtio.h
@@ -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 */
};
OpenPOWER on IntegriCloud