On 01/13/2011 10:18 AM, Avi Kivity wrote:
On 01/13/2011 12:19 PM, Gerd Hoffmann wrote:
  Hi,

Just throwing a quick writeup into the ring to kickstart the design discussion ;)


typedef struct qemu_pvtablet_message {
     uint32_t size;            /* whole message size */
     uint32_t type;            /* qemu_pvtablet_type */
     uint64_t tv_secs;
     uint64_t tv_usecs;

time relative to what base?

can we actually provide it? if the tablet is remote, there may not be a synchronized time source.

I had the same thought, but if it's just treated as time since the init message, the guest is capable of working it out (minus drift).

     union {
         qemu_pvtablet_position position;
         qemu_pvtablet_button   button;
         qemu_pvtablet_display  display;
     } m;
} qemu_pvtablet_message;


So the message size for a qemu_pvtablet_position would only include the position member?

I didn't comment on this because I was treating this as a protocol proposal and not actual code but usually the following is clearer:

struct qemu_pvtablet_hdr {
    uint32_t size;
    uint32_t type;
    uint64_t tv_secs;
    uint64_t tv_usecs;
};

struct qemu_pvtablet_position {
    struct qemu_pvtablet_hdr hdr;
    uint32_t x;
    uint32_t y;
};

union qemu_pvtablet_message {
    struct qemu_pvtablet_hdr hdr;
    struct qemu_pvtablet_position position;
    ...
};

Regards,

Anthony Liguori

Reply via email to