From: Eric Blake <eblake@redhat.com>
To: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Cc: Zhi Yong Wu <zwu.kernel@gmail.com>, Kevin Wolf <kwolf@redhat.com>,
Anthony Liguori <aliguori@us.ibm.com>,
qemu-devel@nongnu.org, libvir-list@redhat.com
Subject: Re: [Qemu-devel] [libvirt] [RFC 0/5] block: File descriptor passing using -open-hook-fd
Date: Thu, 17 May 2012 08:14:15 -0600 [thread overview]
Message-ID: <4FB507B7.7020706@redhat.com> (raw)
In-Reply-To: <20120517134228.GA5079@stefanha-thinkpad.localdomain>
[-- Attachment #1: Type: text/plain, Size: 2266 bytes --]
On 05/17/2012 07:42 AM, Stefan Hajnoczi wrote:
>>>
>>> The -open-hook-fd approach allows QEMU to support file descriptor passing
>>> without changing -drive. It also supports snapshot_blkdev and other commands
>> By the way, How will it support them?
>
> The problem with snapshot_blkdev is that closing a file and opening a
> new file cannot be done by the QEMU process when an SELinux policy is in
> place to prevent opening files.
snapshot_blkdev can take an fd:name instead of a /path/to/file for the
file to open, in which case libvirt can pass in the named fd _prior_ to
the snapshot_blkdev using the 'getfd' monitor command.
>
> The -open-hook-fd approach works even when the QEMU process is not
> allowed to open files since file descriptor passing over a UNIX domain
> socket is used to open files on behalf of QEMU.
The -open-hook-fd approach would indeed allow snapshot_blokdev to ask
for the fd after the fact, but it's much more painful. Consider a case
with a two-disk snapshot:
with the fd:name approach, the sequence is:
libvirt calls getfd:name1 over normal monitor
qemu responds
libvirt calls getfd:name2 over normal monitor
qemu responds
libvirt calls transaction around blockdev-snapshot-sync over normal
monitor, using fd:name1 and fd:name2
qemu responds
but with -open-hook-fd, the approach would be:
libvirt calls transaction
qemu calls open(file1) over hook
libvirt responds
qemu calls open(file2) over hook
libvirt responds
qemu responds to the original transaction
The 'transaction' operation is thus blocked by the time it takes to do
two intermediate opens over a second channel, which kind of defeats the
purpose of making the transaction take effect with minimal guest
downtime. And libvirt code becomes a lot trickier to deal with the fact
that two channels are in use, and that the channel that issued the
'transaction' command must block while the other channel for handling
hooks must be responsive.
I'm really disliking the hook-fd approach, when a better solution is to
make use of 'getfd' in advance of any operation that will need to open
new fds.
--
Eric Blake eblake@redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 620 bytes --]
next prev parent reply other threads:[~2012-05-17 14:15 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-01 15:31 [Qemu-devel] [RFC 0/5] block: File descriptor passing using -open-hook-fd Stefan Hajnoczi
2012-05-01 15:31 ` [Qemu-devel] [RFC 1/5] block: add open() wrapper that can be hooked by libvirt Stefan Hajnoczi
2012-05-01 15:31 ` [Qemu-devel] [RFC 2/5] block: add new command line parameter that and protocol description Stefan Hajnoczi
2012-05-02 8:58 ` Daniel P. Berrange
2012-05-02 9:03 ` Daniel P. Berrange
2012-05-01 15:31 ` [Qemu-devel] [RFC 3/5] block: plumb up open-hook-fd option Stefan Hajnoczi
2012-05-01 15:31 ` [Qemu-devel] [RFC 4/5] osdep: add qemu_recvmsg() wrapper Stefan Hajnoczi
2012-05-01 15:31 ` [Qemu-devel] [RFC 5/5] Example -open-hook-fd server Stefan Hajnoczi
2012-05-01 16:04 ` [Qemu-devel] [libvirt] " Stefan Hajnoczi
2012-05-01 20:25 ` [Qemu-devel] [RFC 0/5] block: File descriptor passing using -open-hook-fd Anthony Liguori
2012-05-01 20:56 ` [Qemu-devel] [libvirt] " Eric Blake
2012-05-01 21:52 ` Anthony Liguori
2012-05-02 16:40 ` Paolo Bonzini
2012-05-01 21:45 ` [Qemu-devel] " Corey Bryant
2012-05-01 21:53 ` Anthony Liguori
2012-05-01 22:15 ` [Qemu-devel] [libvirt] " Eric Blake
2012-05-01 22:21 ` Anthony Liguori
2012-05-07 16:10 ` Corey Bryant
2012-05-02 8:20 ` [Qemu-devel] " Kevin Wolf
2012-05-02 8:27 ` Stefan Hajnoczi
2012-05-02 9:38 ` Kevin Wolf
2012-05-02 8:53 ` [Qemu-devel] [libvirt] " Daniel P. Berrange
2012-05-02 9:45 ` Kevin Wolf
2012-05-02 9:56 ` Daniel P. Berrange
2012-05-02 19:25 ` Paolo Bonzini
2012-05-03 19:19 ` Anthony Liguori
2012-05-02 9:01 ` [Qemu-devel] " Daniel P. Berrange
2012-05-04 3:28 ` [Qemu-devel] [libvirt] " Zhi Yong Wu
2012-05-17 13:42 ` Stefan Hajnoczi
2012-05-17 13:57 ` Zhi Yong Wu
2012-05-17 14:02 ` Zhi Yong Wu
2012-05-18 10:38 ` Stefan Hajnoczi
2012-05-17 14:14 ` Eric Blake [this message]
2012-05-18 10:38 ` Stefan Hajnoczi
2012-07-09 20:00 ` Anthony Liguori
2012-07-09 20:29 ` Eric Blake
2012-07-09 20:46 ` Anthony Liguori
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=4FB507B7.7020706@redhat.com \
--to=eblake@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=kwolf@redhat.com \
--cc=libvir-list@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@linux.vnet.ibm.com \
--cc=zwu.kernel@gmail.com \
/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).