Closed ycaibb closed 2 years ago
I should have added a more detailed description in the original commit, looking at the code I think I did this to protect the migration region as it's written by the fake guest thread:
https://github.com/nutanix/libvfio-user/blob/17769cf1af093dfb4b9bc3347ae39324029989ac/samples/client.c#L821-L834
while it's being read by do_migrate
.
@tmakatos OK, thank you for your clarification.
Hi, it seems the tran_sock_msg_iovec should be protected by locks. https://github.com/nutanix/libvfio-user/blob/17769cf1af093dfb4b9bc3347ae39324029989ac/samples/client.c#L483-L488
However, the method is not guarded in the blow places. https://github.com/nutanix/libvfio-user/blob/17769cf1af093dfb4b9bc3347ae39324029989ac/samples/client.c#L1066-L1078
https://github.com/nutanix/libvfio-user/blob/17769cf1af093dfb4b9bc3347ae39324029989ac/samples/client.c#L427-L437