From: Stefan Hajnoczi <stefanha@gmail.com>
To: "Sinha, Ani" <Ani.Sinha@tellabs.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] qemu virtIO blocking operation - question
Date: Sun, 11 Sep 2011 14:34:48 +0100 [thread overview]
Message-ID: <20110911133448.GA23960@stefanha-thinkpad.localdomain> (raw)
In-Reply-To: <870BD672-6618-4D85-91B0-BE3838C5FCDE@tellabs.com>
On Fri, Sep 09, 2011 at 07:45:17PM -0500, Sinha, Ani wrote:
> So I am writing a virtIO driver for a device that supports blocking calls like poll() etc. Now the front end paravirtualized driver mirrors the request to the backend "host" qemu process that then does the actual call on the host kernel on behalf of the guest. Now my question is, when I do a blocking call from within the callback that I have registered when I created the virtqueue, does it block the entire vcpu? If it does, do I have to create an async context for it? Looking at virtio-net and virtio-block, I can see the concept of bottom halves but I am not sure if this helps me in any way.
What device are you adding? It would help to share what you are trying
to accomplish.
QEMU has an event loop where you can register non-blocking file
descriptors. Callback functions that are invoked when the file
descriptor becomes readable/writable. This is how block I/O,
networking, VNC UI, monitor, etc work and probably what you should do
too.
You may find these posts I wrote helpful, they explain vcpu threads and
the I/O thread:
http://blog.vmsplice.net/2011/03/qemu-internals-big-picture-overview.html
http://blog.vmsplice.net/2011/03/qemu-internals-overall-architecture-and.html
Stefan
next prev parent reply other threads:[~2011-09-11 13:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-10 0:45 [Qemu-devel] qemu virtIO blocking operation - question Sinha, Ani
2011-09-11 13:34 ` Stefan Hajnoczi [this message]
2011-09-12 18:31 ` Sinha, Ani
2011-09-13 9:13 ` Stefan Hajnoczi
2011-09-13 17:35 ` Sinha, Ani
2011-09-15 11:42 ` Stefan Hajnoczi
2011-09-15 22:03 ` Sinha, Ani
2011-09-12 21:05 ` Sinha, Ani
2011-09-13 9:12 ` Stefan Hajnoczi
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=20110911133448.GA23960@stefanha-thinkpad.localdomain \
--to=stefanha@gmail.com \
--cc=Ani.Sinha@tellabs.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).