mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: vsock: Use desc_chain.memory() for header commit
process_rx writes the packet header back into the descriptor chain it is currently processing, so the write must go through that chain's memory snapshot. Rederefing self.mem.memory() resolves to the same snapshot today, but couples the write on the chain to the device's atomic handle and obscures intent. Match the pattern used by the rest of the device by writing through desc_chain.memory(). Suggested-by: Rob Bradford <rbradford@meta.com> Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
committed by
Rob Bradford
parent
496ac197e6
commit
883e3ab7fb
@@ -137,7 +137,7 @@ where
|
||||
) {
|
||||
Ok(mut pkt) => {
|
||||
if self.backend.write().unwrap().recv_pkt(&mut pkt).is_ok() {
|
||||
match pkt.commit_hdr(&*self.mem.memory()) {
|
||||
match pkt.commit_hdr(desc_chain.memory()) {
|
||||
Ok(()) => pkt.hdr().len() as u32 + pkt.len(),
|
||||
Err(err) => {
|
||||
warn!(
|
||||
|
||||
Reference in New Issue
Block a user