From 937c6ff1b7fdbdfd66565b95cb2e37ed0277e007 Mon Sep 17 00:00:00 2001 From: Frederick Mayle Date: Fri, 27 Oct 2023 14:32:00 -0700 Subject: fix vhost-user restore implementation It was using the wrong union member, causing an off by one error. Somehow missed this when testing https://r.android.com/2794978, I probably forgot to rebuild before testing when doing the final polishing. Bug: 295028005 Test: do CF snapshot/restore flow with wifi enabled Change-Id: I2ff07f6f5045d875c80a37b8f15148563714c340 --- wmediumd/lib/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wmediumd/lib/vhost.c b/wmediumd/lib/vhost.c index 4e13012..dbb721b 100644 --- a/wmediumd/lib/vhost.c +++ b/wmediumd/lib/vhost.c @@ -741,7 +741,7 @@ static void usfstl_vhost_user_handle_msg(struct usfstl_loop_entry *entry) usfstl_vhost_user_get_msg_fds(&msghdr, fds, 2); for (virtq = 0; virtq < dev->ext.server->max_queues; virtq++) { - const struct vring_snapshot* snapshot = &msg.payload.snapshot_response.snapshot.vrings[virtq]; + const struct vring_snapshot* snapshot = &msg.payload.restore_request.snapshot.vrings[virtq]; dev->virtqs[virtq].enabled = snapshot->enabled; dev->virtqs[virtq].sleeping = snapshot->sleeping; dev->virtqs[virtq].triggered = snapshot->triggered; -- cgit v1.2.3