From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MOZ0X-000887-SM for qemu-devel@nongnu.org; Wed, 08 Jul 2009 11:24:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MOZ0S-0007zi-JD for qemu-devel@nongnu.org; Wed, 08 Jul 2009 11:24:28 -0400 Received: from [199.232.76.173] (port=46490 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MOZ0S-0007zM-3m for qemu-devel@nongnu.org; Wed, 08 Jul 2009 11:24:24 -0400 Received: from mx2.redhat.com ([66.187.237.31]:47365) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MOZ0R-0005Xm-Ku for qemu-devel@nongnu.org; Wed, 08 Jul 2009 11:24:23 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n68FOMtJ009357 for ; Wed, 8 Jul 2009 11:24:22 -0400 Message-ID: <4A54BABD.3040903@redhat.com> Date: Wed, 08 Jul 2009 18:26:53 +0300 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 3/5] Add getfd and closefd monitor commands References: <1247064963.3270.63.camel@blaa> <1247065048-15706-1-git-send-email-markmc@redhat.com> <1247065048-15706-2-git-send-email-markmc@redhat.com> <1247065048-15706-3-git-send-email-markmc@redhat.com> In-Reply-To: <1247065048-15706-3-git-send-email-markmc@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark McLoughlin Cc: qemu-devel@nongnu.org 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. > + > + fd = dup(fd); > Why? -- error compiling committee.c: too many arguments to function