You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
guest_memory: fixes to Bytes<GuestAddress>::read_from
There are a bug and a small enhancement here. The enhancement is that the
source need not provide the exact number of bytes; try_access supports
partial reads so we can use src.read() instead of src.read_exact().
The bug fix is in the else case, which uses src.read() but then throws
away the result and advances the iterator by the full amount that was
expected.
We could also fix the bug by using src.read_exact() in the else branch,
but read_from() has a return value for partial reads so it's unnecessary
to do that.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
0 commit comments