[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [libvirt] [RFC 0/5] block: File descriptor passing usin
Re: [Qemu-devel] [libvirt] [RFC 0/5] block: File descriptor passing using -open-hook-fd
Tue, 01 May 2012 14:56:50 -0600
Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120424 Thunderbird/12.0
On 05/01/2012 02:25 PM, Anthony Liguori wrote:
> Thanks for sending this out Stefan.
>> This series adds the -open-hook-fd command-line option. Whenever QEMU
>> needs to
>> open an image file it sends a request over the given UNIX domain
>> socket. The
>> response includes the file descriptor or an errno on failure. Please
>> see the
>> patches for details on the protocol.
>> The -open-hook-fd approach allows QEMU to support file descriptor passing
>> without changing -drive. It also supports snapshot_blkdev and other
>> that re-open image files.
>> Anthony Liguori<address@hidden> wrote most of these patches. I
>> added a
>> demo -open-hook-fd server and added some small fixes. Since Anthony is
>> traveling right now I'm sending the RFC for discussion.
> What I like about this approach is that it's useful outside the block
> layer and is conceptionally simple from a QEMU PoV. We simply delegate
> open() to libvirt and let libvirt enforce whatever rules it wants.
> This is not meant to be an alternative to blockdev, but even with
> blockdev, I think we still want to use a mechanism like this even with
The overall series looks like it would be rather interesting. What sort
of timing restrictions are there? For example, the proposed
'drive-reopen' command (probably now delegated to qemu 1.2) would mean
that qemu would be calling back into libvirt in order to do the reopen.
If libvirt takes its time in passing back an open fd, is it going to
starve qemu from answering unrelated monitor commands in the meantime?
I definitely want to make sure we avoid deadlock where libvirt is
waiting on a monitor command, but the monitor command is waiting on
libvirt to pass an fd.
Is this also an opportunity to request whether a particular fd must be
seekable vs. acceptable as a one-pass read or write, perhaps by whether
the command is 1 (seekable open) or 2 (one-pass open)? For example,
migration is one-pass (and therefore libvirt passes a pipe which is
hooked up to a helper app that uses O_DIRECT), while block devices must
Eric Blake address@hidden +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Description: OpenPGP digital signature
- [Qemu-devel] [RFC 0/5] block: File descriptor passing using -open-hook-fd, Stefan Hajnoczi, 2012/05/01
- [Qemu-devel] [RFC 2/5] block: add new command line parameter that and protocol description, Stefan Hajnoczi, 2012/05/01
- [Qemu-devel] [RFC 3/5] block: plumb up open-hook-fd option, Stefan Hajnoczi, 2012/05/01
- [Qemu-devel] [RFC 4/5] osdep: add qemu_recvmsg() wrapper, Stefan Hajnoczi, 2012/05/01
- [Qemu-devel] [RFC 1/5] block: add open() wrapper that can be hooked by libvirt, Stefan Hajnoczi, 2012/05/01
- [Qemu-devel] [RFC 5/5] Example -open-hook-fd server, Stefan Hajnoczi, 2012/05/01
- Re: [Qemu-devel] [RFC 0/5] block: File descriptor passing using -open-hook-fd, Anthony Liguori, 2012/05/01
- Re: [Qemu-devel] [RFC 0/5] block: File descriptor passing using -open-hook-fd, Kevin Wolf, 2012/05/02