Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Nov 2022 15:18:30 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: e52aaa644ce1 - stable/13 - bhyve: Handle snapshots of unconfigured virtio-net devices
Message-ID:  <202211061518.2A6FIUIp055082@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by markj:

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

commit e52aaa644ce186b6f0f38302ad432ddbdf38620a
Author:     Vitaliy Gusev <gusev.vitaliy@gmail.com>
AuthorDate: 2022-10-23 18:47:56 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-11-06 15:18:05 +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
    
    (cherry picked from commit 3b5e5ce87bc885f35100d77b31ac81d3f98342bf)
---
 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 5c3f885fc5ae..3714b34c5066 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);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202211061518.2A6FIUIp055082>