[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 2/4] qapi: Add passfd QMP command
From: |
Luiz Capitulino |
Subject: |
Re: [Qemu-devel] [PATCH v2 2/4] qapi: Add passfd QMP command |
Date: |
Thu, 14 Jun 2012 10:28:51 -0300 |
On Wed, 13 Jun 2012 18:07:43 -0400
Corey Bryant <address@hidden> wrote:
>
>
> On 06/13/2012 04:47 PM, Eric Blake wrote:
> > On 06/13/2012 02:25 PM, Corey Bryant wrote:
> >
> >>> Also, getfd automatically closes a fd if an existing fdname is passed
> >>> again.
> >>> I don't think this is a good behavior, I think pass-fd should fail
> >>> instead
> >>> (note that we can't fix getfd though).
> >>>
> >>
> >> I agree. It makes sense to fail rather than blindly closing the
> >> existing fd. It can be closed explicitly with closefd if the user wants
> >> it closed.
> >
> > Hmm - what happens if I do 'pass-fd name', learn that qemu is using fd
> > 42, then do 'getfd name'? I silently wipe out fd 42 and replace it with
> > the new fd passed in by getfd. Which means my use of /dev/fd/42 will
> > now be broken.
> >
> > Obviously that means that 'getfd' should NOT be used by any application
> > using 'pass-fd', and that libvirt should NOT be reusing names (I think
> > the latter is already true). But I agree that for back-compat we can't
> > get rid of the current (evil) semantics of a duplicated 'getfd'.
>
> Yes, users need to be careful and understand how the commands work. I
> don't think it's a hard rule that 'getfd' can't be used by an
> application that uses 'pass-fd'. If it were, we could put the fds on
> separate lists:
>
> struct Monitor {
> ...
> QLIST_HEAD(,mon_fd_t) fds;
> + QLIST_HEAD(,mon_fd_t) pass_fds;
> };
We'd a different closefd command if we do this.
> But I don't think this is necessary, so I'll plan on documenting them well.
Agreed, I don't think this is necessary.
- Re: [Qemu-devel] [PATCH v2 1/4] qapi: Convert getfd and closefd, (continued)
- Re: [Qemu-devel] [PATCH v2 1/4] qapi: Convert getfd and closefd, Luiz Capitulino, 2012/06/13
- Re: [Qemu-devel] [PATCH v2 1/4] qapi: Convert getfd and closefd, Corey Bryant, 2012/06/13
- Re: [Qemu-devel] [PATCH v2 1/4] qapi: Convert getfd and closefd, Luiz Capitulino, 2012/06/13
- Re: [Qemu-devel] [PATCH v2 1/4] qapi: Convert getfd and closefd, Eric Blake, 2012/06/13
- Re: [Qemu-devel] [PATCH v2 1/4] qapi: Convert getfd and closefd, Corey Bryant, 2012/06/13
[Qemu-devel] [PATCH v2 2/4] qapi: Add passfd QMP command, Corey Bryant, 2012/06/08
[Qemu-devel] [PATCH v2 3/4] osdep: Enable qemu_open to dup pre-opened fd, Corey Bryant, 2012/06/08
[Qemu-devel] [PATCH v2 4/4] block: Convert open calls to qemu_open, Corey Bryant, 2012/06/08
Re: [Qemu-devel] [PATCH v2 0/4] file descriptor passing using passfd, Corey Bryant, 2012/06/08
Re: [Qemu-devel] [PATCH v2 0/4] file descriptor passing using passfd, Kevin Wolf, 2012/06/13