git: 3b5e5ce87bc8 - main - bhyve: Handle snapshots of unconfigured virtio-net devices
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 23 Oct 2022 18:51:16 UTC
The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3b5e5ce87bc885f35100d77b31ac81d3f98342bf commit 3b5e5ce87bc885f35100d77b31ac81d3f98342bf Author: Vitaliy Gusev <gusev.vitaliy@gmail.com> AuthorDate: 2022-10-23 18:47:56 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2022-10-23 18:50:43 +0000 bhyve: Handle snapshots of unconfigured virtio-net devices In case of device reset or not configured - features_negotiated is not set, calling calling pci_vtnet_neg_features is wrong and resume gets "Segmentation fault". Reviewed by: markj Sponsored by: vStack MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D36244 --- usr.sbin/bhyve/pci_virtio_net.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/pci_virtio_net.c b/usr.sbin/bhyve/pci_virtio_net.c index 43e559b650c1..85fa09ca194b 100644 --- a/usr.sbin/bhyve/pci_virtio_net.c +++ b/usr.sbin/bhyve/pci_virtio_net.c @@ -786,9 +786,11 @@ pci_vtnet_snapshot(void *vsc, struct vm_snapshot_meta *meta) */ SNAPSHOT_VAR_OR_LEAVE(sc->vsc_features, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(sc->features_negotiated, meta, ret, done); /* Force reapply negociated features at restore time */ - if (meta->op == VM_SNAPSHOT_RESTORE) { + if (meta->op == VM_SNAPSHOT_RESTORE && + sc->features_negotiated) { pci_vtnet_neg_features(sc, sc->vsc_features); netbe_rx_enable(sc->vsc_be); }