From bb481f6718d09e845247c48538b2cd554f4d8c81 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Sat, 28 Nov 2020 04:06:09 +0000 Subject: [PATCH] bhyve: Add snapshot support for virtio-rnd. This uses the same snapshot routine as other VirtIO devices. Submitted by: Vitaliy Gusev Differential Revision: https://reviews.freebsd.org/D26265 --- usr.sbin/bhyve/pci_virtio_rnd.c | 5 ++++- usr.sbin/bhyve/snapshot.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/pci_virtio_rnd.c b/usr.sbin/bhyve/pci_virtio_rnd.c index 4f908324cfa..10ba9ddfbfa 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 22bfd8d28a6..597c0dbc7bc 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 }, -- 2.45.0