qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: aliguori@us.ibm.com, stefanha@linux.vnet.ibm.com,
	libvir-list@redhat.com, Jeff Cody <jcody@redhat.com>,
	Corey Bryant <coreyb@linux.vnet.ibm.com>,
	qemu-devel@nongnu.org, Luiz Capitulino <lcapitulino@redhat.com>,
	pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3 0/5] file descriptor passing using pass-fd
Date: Tue, 19 Jun 2012 17:57:19 +0200	[thread overview]
Message-ID: <4FE0A15F.7070606@redhat.com> (raw)
In-Reply-To: <4FE09EE3.9070603@redhat.com>

Am 19.06.2012 17:46, schrieb Eric Blake:
> On 06/14/2012 09:55 AM, Corey Bryant wrote:
> 
>> This patch series adds the pass-fd QMP monitor command, which allows
>> an fd to be passed via SCM_RIGHTS, and returns the received file
>> descriptor.  Support is also added to the block layer to allow QEMU
>> to dup the fd when the filename is of the /dev/fd/X format.  This
>> is useful if MAC policy prevents QEMU from opening specific types
>> of files.
> 
> Something to think about on how this will interact with Jeff's work on
> block-commit.  That is an interface where qemu must reopen backing files
> which were previously O_RDONLY to now be O_RDWR.  By default (when
> open() is supported in qemu, and qemu is using the actual file name),
> this means 'block-commit' works without needing any fd names.  But with
> this new fd-passing approach, a file originally opened as O_RDONLY
> /dev/fd/21 will need to be reopened, but the reopened fd will (likely)
> not be 21.  In other words, we need to make sure 'block-commit' supports
> the ability to pass in optional arguments that specify the file name of
> the backing file to be reopened, so that libvirt can pass in O_RDWR fds
> to replace the existing O_RDONLY fd, and be aware that the /dev/fd/nn
> naming of the reopen will be different.

Adding an extra argument to each command that reopens (as in
bdrv_reopen(), i.e. changes flags) internally is one option. In my
opinion not a particularly nice one, though.

Maybe it's better to have a monitor command that just prepares a reopen
and means "for the next reopen of /dev/fd/42, the passed FD will have
the right flags (if it hasn't, the reopen will fail)". We can use dup2()
to keep the "name" stable.

Kevin

  reply	other threads:[~2012-06-19 15:58 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-14 15:55 [Qemu-devel] [PATCH v3 0/5] file descriptor passing using pass-fd Corey Bryant
2012-06-14 15:55 ` [Qemu-devel] [PATCH v3 1/5] qapi: Convert getfd and closefd Corey Bryant
2012-06-14 15:55 ` [Qemu-devel] [PATCH v3 2/5] qapi: Add pass-fd QMP command Corey Bryant
2012-06-15 14:32   ` Luiz Capitulino
2012-06-15 15:04     ` Corey Bryant
2012-06-15 15:14       ` Luiz Capitulino
2012-06-15 15:29         ` Corey Bryant
2012-06-15 16:26           ` Luiz Capitulino
2012-06-14 15:55 ` [Qemu-devel] [PATCH v3 3/5] osdep: Enable qemu_open to dup pre-opened fd Corey Bryant
2012-06-15 15:16   ` Eric Blake
2012-06-15 18:16     ` Corey Bryant
2012-06-15 18:42       ` Eric Blake
2012-06-15 19:02         ` Corey Bryant
2012-06-15 18:46       ` Kevin Wolf
2012-06-15 19:19         ` Corey Bryant
2012-06-15 20:00           ` Eric Blake
2012-06-15 20:49             ` Corey Bryant
2012-06-18  8:10             ` Kevin Wolf
2012-06-19 13:59               ` Corey Bryant
2012-06-14 15:55 ` [Qemu-devel] [PATCH v3 4/5] block: Convert open calls to qemu_open Corey Bryant
2012-06-15 14:36   ` Luiz Capitulino
2012-06-15 15:10     ` Corey Bryant
2012-06-15 15:21   ` Eric Blake
2012-06-15 18:32     ` Corey Bryant
2012-06-14 15:55 ` [Qemu-devel] [PATCH v3 5/5] block: Prevent /dev/fd/X filename from being detected as floppy Corey Bryant
2012-06-15 14:38   ` Luiz Capitulino
2012-06-15 15:12     ` Corey Bryant
2012-06-19 15:46 ` [Qemu-devel] [PATCH v3 0/5] file descriptor passing using pass-fd Eric Blake
2012-06-19 15:57   ` Kevin Wolf [this message]
2012-06-19 16:14     ` Eric Blake
2012-06-20  7:25       ` Kevin Wolf
2012-06-20  8:31         ` Daniel P. Berrange
2012-06-20 11:24           ` Eric Blake
2012-06-20 13:31             ` Corey Bryant
2012-06-20 14:53               ` Eric Blake
2012-06-20 16:24                 ` Corey Bryant

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=4FE0A15F.7070606@redhat.com \
    --to=kwolf@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=coreyb@linux.vnet.ibm.com \
    --cc=eblake@redhat.com \
    --cc=jcody@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@linux.vnet.ibm.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).