mirror of
https://github.com/qemu/qemu.git
synced 2026-07-08 17:46:10 +00:00
Previous patch introduced a limit of max. 1024 simultaneous xattr FIDs. This patch introduces an option "max_attr" that allows to override this limit, just for the case that some user might run into this limit for some reason, even if unlikely; or for reducing the limit further down (e.g. that default limit of 1024 would cap at max. 64 MiB host memory, at least on Linux hosts where the limit per xattr is 64k). This new "max_xattr" option can be specified with both -fsdev and -virtfs command line options, with the "local" and the "synth" fs drivers. The previous limit of 1024 is preserved as the default value. Link: https://lore.kernel.org/qemu-devel/b7631ac0d8dde0629bc7c4f2c4185d9f57b962b4.1781361555.git.qemu_oss@crudebyte.com Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
113 lines
2.7 KiB
C
113 lines
2.7 KiB
C
/*
|
|
* 9p
|
|
*
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or
|
|
* later. See the COPYING file in the top-level directory.
|
|
*/
|
|
|
|
#include "qemu/osdep.h"
|
|
#include "qemu/config-file.h"
|
|
#include "qemu/option.h"
|
|
#include "qemu/module.h"
|
|
#include "qemu/throttle-options.h"
|
|
|
|
static QemuOptsList qemu_fsdev_opts = {
|
|
.name = "fsdev",
|
|
.implied_opt_name = "fsdriver",
|
|
.head = QTAILQ_HEAD_INITIALIZER(qemu_fsdev_opts.head),
|
|
.desc = {
|
|
{
|
|
.name = "fsdriver",
|
|
.type = QEMU_OPT_STRING,
|
|
}, {
|
|
.name = "path",
|
|
.type = QEMU_OPT_STRING,
|
|
}, {
|
|
.name = "security_model",
|
|
.type = QEMU_OPT_STRING,
|
|
}, {
|
|
.name = "writeout",
|
|
.type = QEMU_OPT_STRING,
|
|
}, {
|
|
.name = "readonly",
|
|
.type = QEMU_OPT_BOOL,
|
|
}, {
|
|
.name = "multidevs",
|
|
.type = QEMU_OPT_STRING,
|
|
}, {
|
|
.name = "socket",
|
|
.type = QEMU_OPT_STRING,
|
|
}, {
|
|
.name = "sock_fd",
|
|
.type = QEMU_OPT_NUMBER,
|
|
}, {
|
|
.name = "fmode",
|
|
.type = QEMU_OPT_NUMBER,
|
|
}, {
|
|
.name = "dmode",
|
|
.type = QEMU_OPT_NUMBER,
|
|
}, {
|
|
.name = "max_xattr",
|
|
.type = QEMU_OPT_NUMBER,
|
|
},
|
|
|
|
THROTTLE_OPTS,
|
|
|
|
{ /*End of list */ }
|
|
},
|
|
};
|
|
|
|
static QemuOptsList qemu_virtfs_opts = {
|
|
.name = "virtfs",
|
|
.implied_opt_name = "fsdriver",
|
|
.head = QTAILQ_HEAD_INITIALIZER(qemu_virtfs_opts.head),
|
|
.desc = {
|
|
{
|
|
.name = "fsdriver",
|
|
.type = QEMU_OPT_STRING,
|
|
}, {
|
|
.name = "path",
|
|
.type = QEMU_OPT_STRING,
|
|
}, {
|
|
.name = "mount_tag",
|
|
.type = QEMU_OPT_STRING,
|
|
}, {
|
|
.name = "security_model",
|
|
.type = QEMU_OPT_STRING,
|
|
}, {
|
|
.name = "writeout",
|
|
.type = QEMU_OPT_STRING,
|
|
}, {
|
|
.name = "readonly",
|
|
.type = QEMU_OPT_BOOL,
|
|
}, {
|
|
.name = "multidevs",
|
|
.type = QEMU_OPT_STRING,
|
|
}, {
|
|
.name = "socket",
|
|
.type = QEMU_OPT_STRING,
|
|
}, {
|
|
.name = "sock_fd",
|
|
.type = QEMU_OPT_NUMBER,
|
|
}, {
|
|
.name = "fmode",
|
|
.type = QEMU_OPT_NUMBER,
|
|
}, {
|
|
.name = "dmode",
|
|
.type = QEMU_OPT_NUMBER,
|
|
}, {
|
|
.name = "max_xattr",
|
|
.type = QEMU_OPT_NUMBER,
|
|
},
|
|
|
|
{ /*End of list */ }
|
|
},
|
|
};
|
|
|
|
static void fsdev_register_config(void)
|
|
{
|
|
qemu_add_opts(&qemu_fsdev_opts);
|
|
qemu_add_opts(&qemu_virtfs_opts);
|
|
}
|
|
opts_init(fsdev_register_config);
|