From: Thomas Huth Date: Mon, 11 Nov 2024 13:11:20 +0000 (+0100) Subject: pc-bios/s390-ccw: Re-initialize receive queue index before each boot attempt X-Git-Tag: v9.2.0-rc1~6^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6ba1f714c00f8839a8df9f643e0058f00da3fd25;p=thirdparty%2Fqemu.git pc-bios/s390-ccw: Re-initialize receive queue index before each boot attempt Now that we can boot from multiple boot devices, we have to make sure to reinitialize static variables like rx_last_idx to avoid that they contain garbage data during the second boot attempt (which can lead to crashes when the code tries to access the wrong ring data). Message-ID: <20241111131120.317796-1-thuth@redhat.com> Reviewed-by: Jared Rossi Signed-off-by: Thomas Huth --- diff --git a/pc-bios/s390-ccw/virtio-net.c b/pc-bios/s390-ccw/virtio-net.c index f9854a22c3a..578c89d0c58 100644 --- a/pc-bios/s390-ccw/virtio-net.c +++ b/pc-bios/s390-ccw/virtio-net.c @@ -51,6 +51,8 @@ int virtio_net_init(void *mac_addr) void *buf; int i; + rx_last_idx = 0; + vdev->guest_features[0] = VIRTIO_NET_F_MAC_BIT; virtio_setup_ccw(vdev);