On 02/25/10 15:15, Anthony Liguori wrote:
But I wonder if it really makes sense to treat all of these things
differently since we end up duplicating a lot of code. Would it make
more sense to just introduce:
typedef struct QEMUInputHandler {
void (*put_kbd_event)(QEMUInputHandler *obj, int keycode);
void (*put_led_event)(QEMUInputHandler *obj, int ledstate);
void (*put_mouse_event)(QEMUInputHandler *obj, int dx, int dy, int dz,
int buttons_state);
QLIST_ENTRY(QEMUInputHandler) node;
} QEMUInputHandler;
void qemu_add_input_handler(QEMUInputHandler *handler);
void qemu_remove_input_handler(QEMUInputHandler *handler);
I don't think so. Devil is in the details. Note that kbd_event and
mouse_event go to the kbd/mouse drivers, whereas led_event comes from
the kbd driver, so they are different albeit related beasts.