[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/5] Add getfd and closefd monitor commands
From: |
Mark McLoughlin |
Subject: |
Re: [Qemu-devel] [PATCH 3/5] Add getfd and closefd monitor commands |
Date: |
Wed, 08 Jul 2009 17:03:55 +0100 |
On Wed, 2009-07-08 at 18:26 +0300, Avi Kivity wrote:
> On 07/08/2009 05:57 PM, Mark McLoughlin wrote:
> > Add monitor commands to support passing file descriptors via
> > SCM_RIGHTS.
> >
> > getfd assigns the passed file descriptor a name for use with other
> > monitor commands.
> >
> > closefd allows passed file descriptors to be closed. If a monitor
> > command actually uses a named file descriptor, closefd will not be
> > required.
> >
> >
> >
>
> > @@ -70,6 +70,14 @@ typedef struct mon_cmd_t {
> > const char *help;
> > } mon_cmd_t;
> >
> > +/* file descriptors passed via SCM_RIGHTS */
> > +typedef struct mon_fd_t mon_fd_t;
> > +struct mon_fd_t {
> > + char *name;
> > + int fd;
> > + LIST_ENTRY(mon_fd_t) next;
> > +};
> > +
> >
>
> The _t namespace is reserved by posix and not used for structures in
> qemu anyway. I see there's precedent a few lines above but let's not
> introduce new violations.
Bah, where there's a number of different styles used in a code base, and
where there's no guidelines in CODING_STYLE, I tend to stick with the
style of the code I'm editing. And, in this case, the closest structure
definition used this style.
> > +
> > + fd = dup(fd);
> >
>
> Why?
Because it gets closed again after the chr_read() handler finishes. I
guess we could make qemu_chr_get_msgfd() pass ownership of the fd to the
caller.
Cheers,
Mark.
- Re: [Qemu-devel] [PATCH 0/3] Allow host_net_add monitor command accept file descriptors, (continued)
- Re: [Qemu-devel] [PATCH 0/3] Allow host_net_add monitor command accept file descriptors, Mark McLoughlin, 2009/07/07
- Re: [Qemu-devel] [PATCH 0/3] Allow host_net_add monitor command accept file descriptors, Avi Kivity, 2009/07/07
- Re: [Qemu-devel] [PATCH 0/3] Allow host_net_add monitor command accept file descriptors, Daniel P. Berrange, 2009/07/07
- Re: [Qemu-devel] [PATCH 0/3] Allow host_net_add monitor command accept file descriptors, Mark McLoughlin, 2009/07/08
- [Qemu-devel] [PATCH 1/5] Make tcp_chr_read() use recvmsg(), Mark McLoughlin, 2009/07/08
- [Qemu-devel] [PATCH 2/5] Add SCM_RIGHTS support to unix socket character devices, Mark McLoughlin, 2009/07/08
- [Qemu-devel] [PATCH 3/5] Add getfd and closefd monitor commands, Mark McLoughlin, 2009/07/08
- [Qemu-devel] [PATCH 4/5] Add monitor_get_fd() command for fetching named fds, Mark McLoughlin, 2009/07/08
- [Qemu-devel] [PATCH 5/5] Add support for fd=name to tap and socket networking, Mark McLoughlin, 2009/07/08
- Re: [Qemu-devel] [PATCH 3/5] Add getfd and closefd monitor commands, Avi Kivity, 2009/07/08
- Re: [Qemu-devel] [PATCH 3/5] Add getfd and closefd monitor commands,
Mark McLoughlin <=
- Re: [Qemu-devel] [PATCH 3/5] Add getfd and closefd monitor commands, Avi Kivity, 2009/07/08
- Re: [Qemu-devel] [PATCH 3/5] Add getfd and closefd monitor commands, Anthony Liguori, 2009/07/08
- Re: [Qemu-devel] [PATCH 3/5] Add getfd and closefd monitor commands, Avi Kivity, 2009/07/08
- Re: [Qemu-devel] [PATCH 3/5] Add getfd and closefd monitor commands, Anthony Liguori, 2009/07/08
- Re: [Qemu-devel] [PATCH 3/5] Add getfd and closefd monitor commands, Avi Kivity, 2009/07/08
- Re: [Qemu-devel] [PATCH 3/5] Add getfd and closefd monitor commands, Anthony Liguori, 2009/07/08
- Re: [Qemu-devel] [PATCH 3/5] Add getfd and closefd monitor commands, Avi Kivity, 2009/07/08
- Re: [Qemu-devel] [PATCH 3/5] Add getfd and closefd monitor commands, Jamie Lokier, 2009/07/10
- Re: [Qemu-devel] [PATCH 3/5] Add getfd and closefd monitor commands, Mark McLoughlin, 2009/07/21
- [Qemu-devel] [PATCH] Make tcp_chr_read() use recvmsg(), Mark McLoughlin, 2009/07/21