qemu-devel
[Top][All Lists]
Advanced

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

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


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH 1/4] kbd leds: infrastructure
Date: Thu, 25 Feb 2010 15:36:44 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Thunderbird/3.0

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. 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.

cheers,
  Gerd





reply via email to

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