From: Marcelo Tosatti <mtosatti@redhat.com>
To: Paul Brook <paul@codesourcery.com>
Cc: amit.shah@redhat.com, Anthony Liguori <aliguori@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [patch 1/2] Pass QEMUIOWorker to qemu_notify_event
Date: Fri, 26 Mar 2010 00:55:59 -0300 [thread overview]
Message-ID: <20100326035558.GA20616@amt.cnet> (raw)
In-Reply-To: <201003252106.01194.paul@codesourcery.com>
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.
next prev parent reply other threads:[~2010-03-26 4:01 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-22 13:59 [Qemu-devel] [patch uq/master 0/2] wake iothread on virtio kick / flush_coalesced_mmio smp_wmb Marcelo Tosatti
2010-02-22 13:59 ` [Qemu-devel] [patch uq/master 1/2] virtio-pci: wake up iothread on VIRTIO_PCI_QUEUE_NOTIFY Marcelo Tosatti
2010-02-22 14:20 ` [Qemu-devel] " Avi Kivity
2010-02-22 14:29 ` Marcelo Tosatti
2010-02-22 14:51 ` Avi Kivity
2010-02-22 15:16 ` Marcelo Tosatti
2010-02-22 15:29 ` Anthony Liguori
2010-02-22 15:32 ` Avi Kivity
2010-02-22 15:42 ` Anthony Liguori
2010-02-22 15:55 ` Avi Kivity
2010-03-12 2:45 ` [Qemu-devel] [patch 0/2] introduce QEMUIOWorker and wake up iothread on virtio-serial-bus notification Marcelo Tosatti
2010-03-12 2:45 ` [Qemu-devel] [patch 1/2] Pass QEMUIOWorker to qemu_notify_event Marcelo Tosatti
2010-03-22 21:16 ` Anthony Liguori
2010-03-25 13:47 ` [Qemu-devel] [patch 0/2] introduce QEMUIOWorker and wake up iothread on virtio-serial-bus notification (v2) Marcelo Tosatti
2010-03-25 13:47 ` [Qemu-devel] [patch 1/2] Pass QEMUIOWorker to qemu_notify_event Marcelo Tosatti
2010-03-25 21:06 ` Paul Brook
2010-03-26 3:55 ` Marcelo Tosatti [this message]
2010-03-26 15:23 ` Paul Brook
2010-03-26 15:40 ` Anthony Liguori
2010-03-25 13:47 ` [Qemu-devel] [patch 2/2] virtio-serial-bus: wake up iothread upon guest read notification Marcelo Tosatti
2010-03-12 2:45 ` Marcelo Tosatti
2010-03-12 5:53 ` [Qemu-devel] " Amit Shah
2010-02-22 13:59 ` [Qemu-devel] [patch uq/master 2/2] kvm-all.c: define smp_wmb and use it for coalesced mmio Marcelo Tosatti
2010-02-22 14:23 ` [Qemu-devel] " Avi Kivity
2010-02-22 14:45 ` Marcelo Tosatti
2010-02-22 14:57 ` Avi Kivity
2010-02-22 14:57 ` Michael S. Tsirkin
2010-02-22 15:08 ` Avi Kivity
2010-02-22 15:08 ` Michael S. Tsirkin
2010-02-22 15:28 ` Avi Kivity
2010-02-22 14:44 ` Michael S. Tsirkin
2010-02-22 16:57 ` Marcelo Tosatti
2010-02-22 17:04 ` Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100326035558.GA20616@amt.cnet \
--to=mtosatti@redhat.com \
--cc=aliguori@redhat.com \
--cc=amit.shah@redhat.com \
--cc=paul@codesourcery.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).