qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [patch 1/2] Pass QEMUIOWorker to qemu_notify_event


From: Marcelo Tosatti
Subject: Re: [Qemu-devel] [patch 1/2] Pass QEMUIOWorker to qemu_notify_event
Date: Fri, 26 Mar 2010 00:55:59 -0300
User-agent: Mutt/1.5.20 (2009-08-17)

On Thu, Mar 25, 2010 at 09:06:00PM +0000, Paul Brook wrote:
> >  /* Force QEMU to process pending events */
> > -void qemu_notify_event(void);
> > +void qemu_notify_event(QEMUIOWorker *worker);
> 
> >  static void handle_input(VirtIODevice *vdev, VirtQueue *vq)
> >  {
> > +    qemu_notify_event(main_io_worker);
> >  }
> 
> This feels completely wrong.
> 
> Devices shouldn't know or care about implementation details like this. How is 
> a device supposed to know which worker it should be waking up?

Its not. It could use qemu_notify_event(DeviceInfo->worker), and have no
knowledge of the internals.

> qemu_notify_event is an ugly hack to workaround the fact that our character 
> device API is polled. If shouldn't exist in the first place, instead we 
> should 
> have a proper mechanism for device emulation to notify the CharDriverState 
> when it is ready to recieve more data.

qemu_notify_event is used to break the main_loop_wait out of select(),
to reprocess events that are handled by it (such as ability to receive
more data). Perhaps it is appropriate to move that notification to
another level, but there are other users of it at device level already.





reply via email to

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