[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH 2/4] qmp/hmp: Add getfd_file monitor command

From: Corey Bryant
Subject: Re: [Qemu-devel] [RFC PATCH 2/4] qmp/hmp: Add getfd_file monitor command
Date: Tue, 22 May 2012 09:37:26 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120424 Thunderbird/12.0

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

Signed-off-by: Corey Bryant<address@hidden>

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]