git: 6f7d2cf8bbb5 - main - bhyve: add .pe_snapshot method for PCI 'hostbridge'

From: Corvin Köhne <corvink_at_FreeBSD.org>
Date: Mon, 19 Jun 2023 05:58:01 UTC
The branch main has been updated by corvink:

URL: https://cgit.FreeBSD.org/src/commit/?id=6f7d2cf8bbb5ce6c4dbe0153d54cdc474b5266f4

commit 6f7d2cf8bbb5ce6c4dbe0153d54cdc474b5266f4
Author:     Vitaliy Gusev <gusev.vitaliy@gmail.com>
AuthorDate: 2023-05-15 16:29:56 +0000
Commit:     Corvin Köhne <corvink@FreeBSD.org>
CommitDate: 2023-06-19 05:57:04 +0000

    bhyve: add .pe_snapshot method for PCI 'hostbridge'
    
    There is no error when dump doesn't have it, but to be more
    consistent this PCI devices should be saved as well.
    
    Reviewed by:            corvink, rew
    MFC after:              1 week
    Sponsored by:           vStack
    Differential Revision:  https://reviews.freebsd.org/D40108
---
 usr.sbin/bhyve/pci_hostbridge.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/usr.sbin/bhyve/pci_hostbridge.c b/usr.sbin/bhyve/pci_hostbridge.c
index 03eacc5e134a..90ccda0a79cd 100644
--- a/usr.sbin/bhyve/pci_hostbridge.c
+++ b/usr.sbin/bhyve/pci_hostbridge.c
@@ -86,6 +86,14 @@ pci_amd_hostbridge_legacy_config(nvlist_t *nvl, const char *opts __unused)
 	return (0);
 }
 
+#ifdef BHYVE_SNAPSHOT
+static int
+pci_de_snapshot(struct vm_snapshot_meta *meta __unused)
+{
+	return (0);
+}
+#endif
+
 static const struct pci_devemu pci_de_amd_hostbridge = {
 	.pe_emu = "amd_hostbridge",
 	.pe_legacy_config = pci_amd_hostbridge_legacy_config,
@@ -96,5 +104,8 @@ PCI_EMUL_SET(pci_de_amd_hostbridge);
 static const struct pci_devemu pci_de_hostbridge = {
 	.pe_emu = "hostbridge",
 	.pe_init = pci_hostbridge_init,
+#ifdef BHYVE_SNAPSHOT
+	.pe_snapshot =	pci_de_snapshot,
+#endif
 };
 PCI_EMUL_SET(pci_de_hostbridge);