[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/4] kbd leds: infrastructure

From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 1/4] kbd leds: infrastructure
Date: Thu, 25 Feb 2010 09:07:48 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20091209 Fedora/3.0-4.fc12 Lightning/1.0pre Thunderbird/3.0

On 02/25/2010 08:36 AM, Gerd Hoffmann wrote:
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.

Right, I hadn't thought it through enough.

Should led events be part of DisplayChangeListener? I think you could make the argument that it's part of the display state.


Anthony Liguori

Also the mouse register/unregister does some extra care to update the pointer to the current mouse device, so we can't easily unify the list management.

Juan's suggestion to use QLISTs makes alot of sense though, will do that.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]