Re: [Qemu-devel] [PATCH 1/7] Add support for generic notifier lists

2010-03-15 Thread Anthony Liguori
On 03/15/2010 03:31 PM, Anthony Liguori wrote: On 03/11/2010 08:19 AM, Paul Brook wrote: On 03/11/2010 06:57 AM, Paul Brook wrote: +struct QEMUNotifier +{ +void (*notify)(QEMUNotifier *notifier); +}; I suggest combining this with QEMUBH. I take it your not opposed to converting QEMUBH to

[Qemu-devel] [PATCH 1/7] Add support for generic notifier lists (v2)

2010-03-15 Thread Anthony Liguori
Notifiers are data-less callbacks and a notifier list is a list of registered notifiers that all are interested in a particular event. We'll use this in a few patches to implement mouse change notification. Signed-off-by: Anthony Liguori --- v1 -> v2 - Do not do memory allocations by placing li

Re: [Qemu-devel] [PATCH 1/7] Add support for generic notifier lists

2010-03-15 Thread Anthony Liguori
On 03/11/2010 08:19 AM, Paul Brook wrote: On 03/11/2010 06:57 AM, Paul Brook wrote: +struct QEMUNotifier +{ +void (*notify)(QEMUNotifier *notifier); +}; I suggest combining this with QEMUBH. I take it your not opposed to converting QEMUBH to be a QEMUNotifier? If so

Re: [Qemu-devel] [PATCH 1/7] Add support for generic notifier lists

2010-03-11 Thread Avi Kivity
On 03/11/2010 04:54 PM, Anthony Liguori wrote: I take it your not opposed to converting QEMUBH to be a QEMUNotifier? If so, I'm happy to do it. It's unclear to me why you've invented a new thing in the first place. This style of callback has a number of advantages: - It provides better type

Re: [Qemu-devel] [PATCH 1/7] Add support for generic notifier lists

2010-03-11 Thread Anthony Liguori
On 03/11/2010 08:19 AM, Paul Brook wrote: On 03/11/2010 06:57 AM, Paul Brook wrote: +struct QEMUNotifier +{ +void (*notify)(QEMUNotifier *notifier); +}; I suggest combining this with QEMUBH. I take it your not opposed to converting QEMUBH to be a QEMUNotifier? If so

Re: [Qemu-devel] [PATCH 1/7] Add support for generic notifier lists

2010-03-11 Thread Paul Brook
> On 03/11/2010 06:57 AM, Paul Brook wrote: > >> +struct QEMUNotifier > >> +{ > >> +void (*notify)(QEMUNotifier *notifier); > >> +}; > > > > I suggest combining this with QEMUBH. > > I take it your not opposed to converting QEMUBH to be a QEMUNotifier? > If so, I'm happy to do it. It's unclea

Re: [Qemu-devel] [PATCH 1/7] Add support for generic notifier lists

2010-03-11 Thread Anthony Liguori
On 03/11/2010 07:36 AM, Avi Kivity wrote: On 03/10/2010 06:51 PM, Anthony Liguori wrote: + +#ifndef QEMU_NOTIFY_H +#define QEMU_NOTIFY_H + +#include "qemu-queue.h" + +typedef struct QEMUNotifier QEMUNotifier; +typedef struct QEMUNotifierNode QEMUNotifierNode; + +struct QEMUNotifier +{ +void

Re: [Qemu-devel] [PATCH 1/7] Add support for generic notifier lists

2010-03-11 Thread Anthony Liguori
On 03/11/2010 06:57 AM, Paul Brook wrote: +struct QEMUNotifier +{ +void (*notify)(QEMUNotifier *notifier); +}; I suggest combining this with QEMUBH. I take it your not opposed to converting QEMUBH to be a QEMUNotifier? If so, I'm happy to do it. Regards, Anthony Liguori P

Re: [Qemu-devel] [PATCH 1/7] Add support for generic notifier lists

2010-03-11 Thread Avi Kivity
On 03/10/2010 06:51 PM, Anthony Liguori wrote: + +#ifndef QEMU_NOTIFY_H +#define QEMU_NOTIFY_H + +#include "qemu-queue.h" + +typedef struct QEMUNotifier QEMUNotifier; +typedef struct QEMUNotifierNode QEMUNotifierNode; + +struct QEMUNotifier +{ +void (*notify)(QEMUNotifier *notifier); +}; + +s

Re: [Qemu-devel] [PATCH 1/7] Add support for generic notifier lists

2010-03-11 Thread Paul Brook
> +struct QEMUNotifier > +{ > +void (*notify)(QEMUNotifier *notifier); > +}; > I suggest combining this with QEMUBH. Paul

[Qemu-devel] [PATCH 1/7] Add support for generic notifier lists

2010-03-10 Thread Anthony Liguori
Notifiers are data-less callbacks and a notifier list is a list of registered notifiers that all are interested in a particular event. We'll use this in a few patches to implement mouse change notification. Signed-off-by: Anthony Liguori --- Makefile.objs |1 + notify.c | 53