From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWpHu-0008IE-FS for qemu-devel@nongnu.org; Tue, 22 May 2012 09:38:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SWpHo-0006Mt-Pt for qemu-devel@nongnu.org; Tue, 22 May 2012 09:38:10 -0400 Received: from e38.co.us.ibm.com ([32.97.110.159]:40153) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWpHo-0006Ly-Jj for qemu-devel@nongnu.org; Tue, 22 May 2012 09:38:04 -0400 Received: from /spool/local by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 22 May 2012 07:37:59 -0600 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 4ACD6C90071 for ; Tue, 22 May 2012 09:37:26 -0400 (EDT) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q4MDbSdI074070 for ; Tue, 22 May 2012 09:37:29 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q4MJ8LvP029288 for ; Tue, 22 May 2012 15:08:21 -0400 Message-ID: <4FBB9696.3010404@linux.vnet.ibm.com> Date: Tue, 22 May 2012 09:37:26 -0400 From: Corey Bryant MIME-Version: 1.0 References: <1337631598-30639-1-git-send-email-coreyb@linux.vnet.ibm.com> <1337631598-30639-3-git-send-email-coreyb@linux.vnet.ibm.com> <4FBAB81F.7080408@redhat.com> In-Reply-To: <4FBAB81F.7080408@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 2/4] qmp/hmp: Add getfd_file monitor command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, libvir-list@redhat.com, aliguori@us.ibm.com, stefanha@linux.vnet.ibm.com, qemu-devel@nongnu.org On 05/21/2012 05:48 PM, Eric Blake wrote: > On 05/21/2012 02:19 PM, Corey Bryant wrote: >> This patch provides support for the getfd_file monitor command. >> This command will allow passing of a filename and its corresponding >> file descriptor to a guest via the monitor. This command could be >> followed, for example, by a drive_add command to hot attach a disk >> drive. >> >> Signed-off-by: Corey Bryant > > Is the only difference between 'getfd' and 'getfd_file' the fact that > 'getfd' introduces an abstract namespace usable only by the fd: > protocol, while the 'getfd_file' introduces a name identical to the > absolute naming of the file system and usable by the file: protocol? The only difference is that getfd passes an fdname to associate to the fd, and getfd_file passes a filename to associate to the fd. These name/fd pairs are stored separately so there won't be any conflicts (ie. fdname == filename). > What happens if I pass 'getfd_file' a relative file name? Must the > filename passed to 'getfd_file' be in canonical form, or may it contain > symlinks, .., and other non-canonical constructs? As the code is now, the 'getfd_file' filename has to be the same as the 'drive_add' filename, for example. And the same goes for the '-drive' filename and the '-filfd' filename. I didn't introduce any special handling to canonicalize the filenames, but I think it is necessary. Either in QEMU or libvirt, but it probably makes more sense to canonicalize in QEMU. > > Can the 'closefd' command be used to close the fd originally given to > qemu via 'getfd_file'? > No, 'closefd' won't close an fd passed in by 'getfd_file'. I was thinking I should probably add a 'closefd_file' that could do this. -- Regards, Corey