summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2020-11-28 04:06:09 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2020-11-28 04:06:09 +0000
commitbb481f6718d09e845247c48538b2cd554f4d8c81 (patch)
treeeb7cc70131994c7dea71d591dabba949ae17182c /usr.sbin
parent57b0a3aacad90d59a6fa1024225d08b1a9c35298 (diff)
downloadsrc-test2-bb481f6718d09e845247c48538b2cd554f4d8c81.tar.gz
src-test2-bb481f6718d09e845247c48538b2cd554f4d8c81.zip
bhyve: Add snapshot support for virtio-rnd.
This uses the same snapshot routine as other VirtIO devices. Submitted by: Vitaliy Gusev <gusev.vitaliy@gmail.com> Differential Revision: https://reviews.freebsd.org/D26265
Notes
Notes: svn path=/head/; revision=368118
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bhyve/pci_virtio_rnd.c5
-rw-r--r--usr.sbin/bhyve/snapshot.c1
2 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/bhyve/pci_virtio_rnd.c b/usr.sbin/bhyve/pci_virtio_rnd.c
index 4f908324cfa9..10ba9ddfbfaf 100644
--- a/usr.sbin/bhyve/pci_virtio_rnd.c
+++ b/usr.sbin/bhyve/pci_virtio_rnd.c
@@ -205,6 +205,9 @@ struct pci_devemu pci_de_vrnd = {
.pe_emu = "virtio-rnd",
.pe_init = pci_vtrnd_init,
.pe_barwrite = vi_pci_write,
- .pe_barread = vi_pci_read
+ .pe_barread = vi_pci_read,
+#ifdef BHYVE_SNAPSHOT
+ .pe_snapshot = vi_pci_snapshot,
+#endif
};
PCI_EMUL_SET(pci_de_vrnd);
diff --git a/usr.sbin/bhyve/snapshot.c b/usr.sbin/bhyve/snapshot.c
index 22bfd8d28a61..597c0dbc7bc5 100644
--- a/usr.sbin/bhyve/snapshot.c
+++ b/usr.sbin/bhyve/snapshot.c
@@ -147,6 +147,7 @@ const struct vm_snapshot_dev_info snapshot_devs[] = {
{ "atkbdc", atkbdc_snapshot, NULL, NULL },
{ "virtio-net", pci_snapshot, pci_pause, pci_resume },
{ "virtio-blk", pci_snapshot, pci_pause, pci_resume },
+ { "virtio-rnd", pci_snapshot, NULL, NULL },
{ "lpc", pci_snapshot, NULL, NULL },
{ "fbuf", pci_snapshot, NULL, NULL },
{ "xhci", pci_snapshot, NULL, NULL },