From: Corey Bryant <coreyb@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, aliguori@us.ibm.com,
stefanha@linux.vnet.ibm.com, libvir-list@redhat.com,
eblake@redhat.com
Subject: [Qemu-devel] [RFC PATCH 1/4] qemu-options: Add -filefd command line option
Date: Mon, 21 May 2012 16:19:55 -0400 [thread overview]
Message-ID: <1337631598-30639-2-git-send-email-coreyb@linux.vnet.ibm.com> (raw)
In-Reply-To: <1337631598-30639-1-git-send-email-coreyb@linux.vnet.ibm.com>
This patch provides support for the -filefd command line option.
This option will allow passing of a filename and its corresponding
file descriptor to QEMU at exec time.
Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
---
qemu-config.c | 17 +++++++++++++++++
qemu-config.h | 1 +
qemu-options.hx | 17 +++++++++++++++++
3 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/qemu-config.c b/qemu-config.c
index be84a03..64afac6 100644
--- a/qemu-config.c
+++ b/qemu-config.c
@@ -613,6 +613,22 @@ QemuOptsList qemu_boot_opts = {
},
};
+QemuOptsList qemu_filefd_opts = {
+ .name = "filefd",
+ .head = QTAILQ_HEAD_INITIALIZER(qemu_filefd_opts.head),
+ .desc = {
+ {
+ .name = "file",
+ .type = QEMU_OPT_STRING,
+ }, {
+ .name = "fd",
+ .type = QEMU_OPT_NUMBER,
+ },
+ { /*End of list */ }
+ },
+};
+
+
static QemuOptsList *vm_config_groups[32] = {
&qemu_drive_opts,
&qemu_chardev_opts,
@@ -628,6 +644,7 @@ static QemuOptsList *vm_config_groups[32] = {
&qemu_machine_opts,
&qemu_boot_opts,
&qemu_iscsi_opts,
+ &qemu_filefd_opts,
NULL,
};
diff --git a/qemu-config.h b/qemu-config.h
index 6d7365d..6be54f1 100644
--- a/qemu-config.h
+++ b/qemu-config.h
@@ -4,6 +4,7 @@
extern QemuOptsList qemu_fsdev_opts;
extern QemuOptsList qemu_virtfs_opts;
extern QemuOptsList qemu_spice_opts;
+extern QemuOptsList qemu_filefd_opts;
QemuOptsList *qemu_find_opts(const char *group);
void qemu_add_opts(QemuOptsList *list);
diff --git a/qemu-options.hx b/qemu-options.hx
index 8b66264..5f6782c 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -2743,6 +2743,23 @@ DEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log,
"-qtest-log LOG specify tracing options\n",
QEMU_ARCH_ALL)
+DEF("filefd", HAS_ARG, QEMU_OPTION_filefd,
+ "-filefd file=<filename>,fd=<fd>\n"
+ " passes a filename and its corresponding file descriptor\n",
+ QEMU_ARCH_ALL)
+STEXI
+@item -filefd file=@var{filename},fd=@var{fd}
+@findex -filefd
+This is used when a management application opens a file on behalf of QEMU.
+Instead of performing an open, QEMU will use the fd passed on this option.
+@table @option
+@item file=@var{filename}
+The name of the file.
+@item fd=@var{fd}
+The file descriptor that corresponds to @var{filename}.
+@end table
+ETEXI
+
HXCOMM This is the last statement. Insert new options before this line!
STEXI
@end table
--
1.7.7.6
next prev parent reply other threads:[~2012-05-21 20:20 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-21 20:19 [Qemu-devel] [RFC PATCH 0/4] block: file descriptor passing using -filefd and getfd_file Corey Bryant
2012-05-21 20:19 ` Corey Bryant [this message]
2012-05-21 21:40 ` [Qemu-devel] [RFC PATCH 1/4] qemu-options: Add -filefd command line option Eric Blake
2012-05-22 13:25 ` Corey Bryant
2012-05-22 13:38 ` Kevin Wolf
2012-05-22 14:26 ` Stefan Hajnoczi
2012-05-22 14:39 ` Kevin Wolf
2012-05-21 20:19 ` [Qemu-devel] [RFC PATCH 2/4] qmp/hmp: Add getfd_file monitor command Corey Bryant
2012-05-21 21:48 ` Eric Blake
2012-05-22 13:37 ` Corey Bryant
2012-05-22 9:18 ` Stefan Hajnoczi
2012-05-22 14:13 ` Corey Bryant
2012-05-22 19:06 ` Luiz Capitulino
2012-05-22 20:02 ` Corey Bryant
2012-05-22 20:26 ` Luiz Capitulino
2012-05-22 22:34 ` Corey Bryant
2012-05-23 13:33 ` Luiz Capitulino
2012-05-23 13:45 ` Corey Bryant
2012-05-21 20:19 ` [Qemu-devel] [RFC PATCH 3/4] block: Enable QEMU to retrieve passed fd before attempting open Corey Bryant
2012-05-21 21:50 ` Eric Blake
2012-05-22 14:06 ` Corey Bryant
2012-05-21 20:19 ` [Qemu-devel] [RFC PATCH 4/4] Example -filefd and getfd_file server Corey Bryant
2012-05-22 8:18 ` [Qemu-devel] [RFC PATCH 0/4] block: file descriptor passing using -filefd and getfd_file Kevin Wolf
2012-05-22 12:02 ` Eric Blake
2012-05-22 12:08 ` Kevin Wolf
2012-05-22 14:30 ` Corey Bryant
2012-05-22 14:45 ` Kevin Wolf
2012-05-22 15:01 ` Eric Blake
2012-05-22 15:24 ` Kevin Wolf
2012-05-22 15:29 ` Corey Bryant
2012-05-22 15:39 ` Kevin Wolf
2012-05-22 16:02 ` Corey Bryant
2012-05-22 16:15 ` Eric Blake
2012-05-22 17:17 ` Corey Bryant
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1337631598-30639-2-git-send-email-coreyb@linux.vnet.ibm.com \
--to=coreyb@linux.vnet.ibm.com \
--cc=aliguori@us.ibm.com \
--cc=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=libvir-list@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).