qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] qemu virtIO blocking operation - question


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] qemu virtIO blocking operation - question
Date: Sun, 11 Sep 2011 14:34:48 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

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



reply via email to

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