summaryrefslogtreecommitdiffstats
path: root/server/snd_worker.h
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2010-10-15 09:08:10 +0200
committerHans de Goede <hdegoede@redhat.com>2010-10-15 10:22:37 +0200
commita52324525d5707365c4b6758e5d5b08f21b0ac31 (patch)
treea5faec7270f23d3ab1bf5976b30136fb46f7e66b /server/snd_worker.h
parentd37adccfa7e4586a68e7da8a225de0a50c6eeff5 (diff)
downloadspice-a52324525d5707365c4b6758e5d5b08f21b0ac31.tar.gz
spice-a52324525d5707365c4b6758e5d5b08f21b0ac31.tar.xz
spice-a52324525d5707365c4b6758e5d5b08f21b0ac31.zip
server: always call read_from_vdi_port() in a while loop
read_from_vdi_port() MUST always be called in a while loop until it returns 0. This is needed because it can cause new data available events and its recursion protection causes those to get lost. Calling it until it returns 0 ensures that all data has been consumed. Example scenario where we can fail to read the available data otherwise: - server/reds.c: vdagent_char_device_wakeup get called by hw/spice-vmc.c because data has arrived from the guest, - hw/spice-vmc.c: vmc_read get calls - If the vmc_read call depletes the current buffer it calls virtio_serial_throttle_port(&svc->port, false) - This causes vmc_have_data to get called, which if in the mean time another buffer has arrived causes vdagent_char_device_wakeup to gets called again (so recursively) - vdagent_char_device_wakeup is protected against recursive calling and ignores the second call (a nasty hack) - if no other data arrives, the arrived data will not get read
Diffstat (limited to 'server/snd_worker.h')
0 files changed, 0 insertions, 0 deletions