Revision 35106c2d spice-qemu-char.c
b/spice-qemu-char.c | ||
---|---|---|
36 | 36 |
|
37 | 37 |
while (len > 0) { |
38 | 38 |
last_out = MIN(len, VMC_MAX_HOST_WRITE); |
39 |
qemu_chr_read(scd->chr, p, last_out); |
|
40 |
if (last_out > 0) { |
|
41 |
out += last_out; |
|
42 |
len -= last_out; |
|
43 |
p += last_out; |
|
44 |
} else { |
|
39 |
if (qemu_chr_can_read(scd->chr) < last_out) { |
|
45 | 40 |
break; |
46 | 41 |
} |
42 |
qemu_chr_read(scd->chr, p, last_out); |
|
43 |
out += last_out; |
|
44 |
len -= last_out; |
|
45 |
p += last_out; |
|
47 | 46 |
} |
48 | 47 |
|
49 | 48 |
dprintf(scd, 3, "%s: %lu/%zd\n", __func__, out, len + out); |
Also available in: Unified diff