|
| From: | Romain Naour |
| Subject: | Re: [Qemu-devel] [PATCH v2 1/1] genius: add genius serial mouse emulation |
| Date: | Sat, 18 Jan 2014 22:43:31 +0100 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 |
|
Hi, [snip] + int dx; + int dy; + int button; + struct QEMUTimer *transmit_timer; /* QEMU timer */ + uint64_t transmit_time; /* time to transmit a char in ticks */ + unsigned char data[5]; + int index; +} gnmouse_save;How does all this state get migrated at VM migration? I know how this works for device models, but does anybody know the answer for char backends? [snip] Yes indeed, thanks. [snip] These additional bytes are intended to send the movement made since the beginning of the frame transfer.Also, it could use a comment. If I understand the logic correctly, something like: /* Send as much of our accumulated delta as we can fit into * the packet format. Anything remaining will get sent in a * subsequent packet. */ [snip] + /* reload timer */If I do like msmouse, the receive buffer is flooded by each GUI event and the last frame is not entirely received.This comment is stating the obvious. It would be more interesting to know why we have a timer at all... I hav'nt found a better solution than using a timer... I added a comment for that in v3. [snip] Yes it's really "bit set if button is up".+ + /* Buttons */ + BP |= (buttons_state & 0x01 ? 0x00 : 0x04); /* BP1 = L */ + BP |= (buttons_state & 0x02 ? 0x00 : 0x01); /* BP2 = R */ + BP |= (buttons_state & 0x04 ? 0x00 : 0x02); /* BP4 = M */Are these really 'bit set if button is up' ? If so that could use a comment, because that's a bit of a weird protocol design. I'm agree with you, I added a comment in the documentation to says that. Thank you for your time and review ! Best regards, Romain Naour |
| [Prev in Thread] | Current Thread | [Next in Thread] |