Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vsock: Incorrect number of bytes of data received from vsock on Windows #1035

Open
niceguy135 opened this issue Jan 24, 2024 · 1 comment
Open
Assignees
Labels

Comments

@niceguy135
Copy link

Describe the bug
A test script is running on the host, sending bytes of data over vsock. Another application that has developed with a wrapper for working with vsock receives this data on Windows guest.

The problem is that vsok on the WIndows side reads randomly more or less data than was sent from the Linux side.

TraceView logs:
LogSession0.txt

To Reproduce
On Linux host run this:
vsock_test.txt

On Windows guest run this:
client_test.txt
With this imported vsock wrapper:
winSock.txt

Expected behavior
Well, I kind of expect WIndows to receive exactly as many bytes over vsock as it is sent)

Screenshots

From Linux host:
Linux host terminal screanshoot

From Windows guest:
cmd

Host:

  • Disto: "Linux Mint 21.1 (Vera)"
  • Kernel version: 5.15.0-91-generic
  • QEMU version: QEMU emulator version 6.2.0 (Debian 1:6.2+dfsg-2ubuntu6.15)
  • QEMU command line: launch from VirtManager app (i think qemu-system-x86_64 will be good)
  • libvirt version: 6.2.0
  • libvirt XML file for windows:
    windows10.txt

VM:

  • Windows version: Windows 10 Pro Build 19041.vb_release.191206-1206
  • Which driver has a problem: viosock
  • last commit hash: 515a6a2

Additional context
The problem disappears (for the current test) if you increase the buffer. But this approach to solving the problem does not seem right to me

@MartinDrab
Copy link
Contributor

Hello,

IMHO this is a feature, not a bug. The socket is of the SOCK_STREAM; type which means that data are being sent and received as a stream of bytes. Thus, sending **N** bytes in one sendcall does not imply their reception in onerecv` call. It depends on how quickly the data are transferred between the host and the VM.

You would need a datagram (message-based) socket, however, I do not think such sockets are supported by the Socket driver at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants