xref: /openbmc/qemu/fsdev/qemu-fsdev-opts.c (revision 4a09d0bb)
1 /*
2  * 9p
3  *
4  * This work is licensed under the terms of the GNU GPL, version 2 or
5  * later.  See the COPYING file in the top-level directory.
6  */
7 
8 #include "qemu/osdep.h"
9 #include "qemu/config-file.h"
10 #include "qemu/option.h"
11 #include "qemu/module.h"
12 
13 static QemuOptsList qemu_fsdev_opts = {
14     .name = "fsdev",
15     .implied_opt_name = "fsdriver",
16     .head = QTAILQ_HEAD_INITIALIZER(qemu_fsdev_opts.head),
17     .desc = {
18         {
19             .name = "fsdriver",
20             .type = QEMU_OPT_STRING,
21         }, {
22             .name = "path",
23             .type = QEMU_OPT_STRING,
24         }, {
25             .name = "security_model",
26             .type = QEMU_OPT_STRING,
27         }, {
28             .name = "writeout",
29             .type = QEMU_OPT_STRING,
30         }, {
31             .name = "readonly",
32             .type = QEMU_OPT_BOOL,
33 
34         }, {
35             .name = "socket",
36             .type = QEMU_OPT_STRING,
37         }, {
38             .name = "sock_fd",
39             .type = QEMU_OPT_NUMBER,
40         },
41 
42         { /*End of list */ }
43     },
44 };
45 
46 static QemuOptsList qemu_virtfs_opts = {
47     .name = "virtfs",
48     .implied_opt_name = "fsdriver",
49     .head = QTAILQ_HEAD_INITIALIZER(qemu_virtfs_opts.head),
50     .desc = {
51         {
52             .name = "fsdriver",
53             .type = QEMU_OPT_STRING,
54         }, {
55             .name = "path",
56             .type = QEMU_OPT_STRING,
57         }, {
58             .name = "mount_tag",
59             .type = QEMU_OPT_STRING,
60         }, {
61             .name = "security_model",
62             .type = QEMU_OPT_STRING,
63         }, {
64             .name = "writeout",
65             .type = QEMU_OPT_STRING,
66         }, {
67             .name = "readonly",
68             .type = QEMU_OPT_BOOL,
69         }, {
70             .name = "socket",
71             .type = QEMU_OPT_STRING,
72         }, {
73             .name = "sock_fd",
74             .type = QEMU_OPT_NUMBER,
75         },
76 
77         { /*End of list */ }
78     },
79 };
80 
81 static void fsdev_register_config(void)
82 {
83     qemu_add_opts(&qemu_fsdev_opts);
84     qemu_add_opts(&qemu_virtfs_opts);
85 }
86 opts_init(fsdev_register_config);
87