From: Nikita Shubin <n.shubin@yadro.com>
To: qemu-devel@nongnu.org
Cc: "Linus Walleij" <linus.walleij@linaro.org>,
"Bartosz Golaszewski" <brgl@bgdev.pl>,
"Enrico Weigelt, metux IT consult" <info@metux.net>,
"Viresh Kumar" <vireshk@kernel.org>,
"Eric Blake" <eblake@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Michael Roth" <michael.roth@amd.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Cédric Le Goater" <clg@kaod.org>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Steven Lee" <steven_lee@aspeedtech.com>,
"Troy Lee" <leetroy@gmail.com>,
"Jamin Lin" <jamin_lin@aspeedtech.com>,
"Andrew Jeffery" <andrew@codeconstruct.com.au>,
"Joel Stanley" <joel@jms.id.au>,
qemu-arm@nongnu.org, "Nikita Shubin" <nikita.shubin@maquefel.me>,
"Nikita Shubin" <n.shubin@yadro.com>
Subject: [PATCH PoC 2/7] Add gpiodev dummy
Date: Wed, 19 Mar 2025 10:57:52 +0300 [thread overview]
Message-ID: <20250319-gpiodev-v1-2-76da4e5800a1@yadro.com> (raw)
In-Reply-To: <20250319-gpiodev-v1-0-76da4e5800a1@yadro.com>
Add gpiodev stub with single help option.
Signed-off-by: Nikita Shubin <n.shubin@yadro.com>
---
gpiodev/gpio.c | 145 +++++++++++++++++++++++++++++++++++++++++++++++++
gpiodev/meson.build | 5 ++
include/gpiodev/gpio.h | 34 ++++++++++++
meson.build | 11 +++-
qemu-options.hx | 9 +++
system/vl.c | 25 +++++++++
6 files changed, 228 insertions(+), 1 deletion(-)
diff --git a/gpiodev/gpio.c b/gpiodev/gpio.c
new file mode 100644
index 0000000000000000000000000000000000000000..0f84fb6c502bd6d0a5f808bc299fabd4144c2909
--- /dev/null
+++ b/gpiodev/gpio.c
@@ -0,0 +1,145 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * QEMU GPIO device.
+ *
+ * Author: 2025 Nikita Shubin <n.shubin@yadro.com>
+ *
+ */
+#include "qemu/osdep.h"
+
+#include "qapi/error.h"
+#include "qemu/config-file.h"
+#include "qemu/option.h"
+#include "qemu/qemu-print.h"
+#include "qemu/help_option.h"
+
+#include "gpiodev/gpio.h"
+
+static Object *get_gpiodevs_root(void)
+{
+ return object_get_container("gpiodevs");
+}
+
+static const TypeInfo gpiodev_types_info[] = {
+ {
+ .name = TYPE_GPIODEV,
+ .parent = TYPE_OBJECT,
+ .instance_size = sizeof(Gpiodev),
+ .abstract = true,
+ },
+};
+
+DEFINE_TYPES(gpiodev_types_info);
+
+static Gpiodev *gpiodev_new(const char *id,
+ GMainContext *gcontext,
+ Error **errp)
+{
+ Object *obj;
+ Gpiodev *gpio = NULL;
+
+ assert(id);
+
+ obj = object_new(TYPE_GPIODEV);
+ gpio = GPIODEV(obj);
+ gpio->gcontext = gcontext;
+
+ return gpio;
+}
+
+static Gpiodev *qemu_gpiodev_new(const char *id,
+ GMainContext *gcontext,
+ Error **errp)
+{
+ Gpiodev *gpio;
+
+ gpio = gpiodev_new(id, gcontext, errp);
+ if (!gpio) {
+ return NULL;
+ }
+
+ if (!object_property_try_add_child(get_gpiodevs_root(), id, OBJECT(gpio),
+ errp)) {
+ object_unref(OBJECT(gpio));
+ return NULL;
+ }
+
+ object_unref(OBJECT(gpio));
+
+ return gpio;
+}
+
+typedef struct GpiodevClassFE {
+ void (*fn)(const char *name, void *opaque);
+ void *opaque;
+} GpiodevClassFE;
+
+static void
+gpiodev_class_foreach(ObjectClass *klass, void *opaque)
+{
+ GpiodevClassFE *fe = opaque;
+
+ assert(g_str_has_prefix(object_class_get_name(klass), "gpiodev-"));
+ fe->fn(object_class_get_name(klass) + 8, fe->opaque);
+}
+
+static void
+gpiodev_name_foreach(void (*fn)(const char *name, void *opaque),
+ void *opaque)
+{
+ GpiodevClassFE fe = { .fn = fn, .opaque = opaque };
+
+ object_class_foreach(gpiodev_class_foreach, TYPE_GPIODEV, false, &fe);
+}
+
+static void
+help_string_append(const char *name, void *opaque)
+{
+ GString *str = opaque;
+
+ g_string_append_printf(str, "\n %s", name);
+}
+
+Gpiodev *qemu_gpiodev_add(QemuOpts *opts, GMainContext *context,
+ Error **errp)
+{
+ const char *id = qemu_opts_id(opts);
+ const char *name = qemu_opt_get(opts, "backend");
+
+ if (name && is_help_option(name)) {
+ GString *str = g_string_new("");
+
+ gpiodev_name_foreach(help_string_append, str);
+
+ qemu_printf("Available chardev backend types: %s\n", str->str);
+ g_string_free(str, true);
+ return NULL;
+ }
+
+ if (id == NULL) {
+ error_setg(errp, "gpiodev: no id specified");
+ return NULL;
+ }
+
+ return qemu_gpiodev_new(id, context, errp);
+}
+
+static QemuOptsList qemu_gpiodev_opts = {
+ .name = "gpiodev",
+ .implied_opt_name = "backend",
+ .head = QTAILQ_HEAD_INITIALIZER(qemu_gpiodev_opts.head),
+ .desc = {
+ {
+ .name = "backend",
+ .type = QEMU_OPT_STRING,
+ },
+ { /* end of list */ }
+ },
+};
+
+static void gpiodev_register_config(void)
+{
+ qemu_add_opts(&qemu_gpiodev_opts);
+}
+
+opts_init(gpiodev_register_config);
diff --git a/gpiodev/meson.build b/gpiodev/meson.build
new file mode 100644
index 0000000000000000000000000000000000000000..05aeb266bce8d905753d90d917b5f8b2d265a0cf
--- /dev/null
+++ b/gpiodev/meson.build
@@ -0,0 +1,5 @@
+gpiodev_ss.add(files(
+ 'gpio.c',
+))
+
+gpiodev_ss = gpiodev_ss.apply({})
diff --git a/include/gpiodev/gpio.h b/include/gpiodev/gpio.h
new file mode 100644
index 0000000000000000000000000000000000000000..aca0a6090bb5264e1646fa5facace2d8f7cc47fd
--- /dev/null
+++ b/include/gpiodev/gpio.h
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * QEMU GPIO device.
+ *
+ * Author: 2025 Nikita Shubin <n.shubin@yadro.com>
+ *
+ */
+#ifndef QEMU_GPIO_H
+#define QEMU_GPIO_H
+
+#include "qom/object.h"
+
+/* gpio back-end device */
+typedef struct GpioBackend GpioBackend;
+
+struct Gpiodev {
+ Object parent_obj;
+
+ GpioBackend *be;
+
+ GMainContext *gcontext;
+};
+
+struct GpiodevClass {
+ ObjectClass parent_class;
+};
+
+#define TYPE_GPIODEV "gpiodev"
+OBJECT_DECLARE_TYPE(Gpiodev, GpiodevClass, GPIODEV)
+
+Gpiodev *qemu_gpiodev_add(QemuOpts *opts, GMainContext *context,
+ Error **errp);
+
+#endif /* QEMU_GPIO_H */
diff --git a/meson.build b/meson.build
index 8b9fda4d95e634e6faa8db5604e5e0ddc4b1eb9e..9daac5783bcf459a3ee6ff1e999582bf4e9a47cc 100644
--- a/meson.build
+++ b/meson.build
@@ -3646,6 +3646,7 @@ block_ss = ss.source_set()
chardev_ss = ss.source_set()
common_ss = ss.source_set()
crypto_ss = ss.source_set()
+gpiodev_ss = ss.source_set()
hwcore_ss = ss.source_set()
io_ss = ss.source_set()
qmp_ss = ss.source_set()
@@ -3735,6 +3736,7 @@ subdir('io')
subdir('chardev')
subdir('fsdev')
subdir('dump')
+subdir('gpiodev')
if have_block
block_ss.add(files(
@@ -4023,11 +4025,18 @@ libhwcore = static_library('hwcore', sources: hwcore_ss.sources() + genh,
hwcore = declare_dependency(objects: libhwcore.extract_all_objects(recursive: false))
common_ss.add(hwcore)
+libgpiodev = static_library('gpiodev', gpiodev_ss.sources() + genh,
+ dependencies: gpiodev_ss.dependencies(),
+ build_by_default: false)
+
+gpiodev = declare_dependency(objects: libgpiodev.extract_all_objects(recursive: false),
+ dependencies: gpiodev_ss.dependencies())
+
###########
# Targets #
###########
-system_ss.add(authz, blockdev, chardev, crypto, io, qmp)
+system_ss.add(authz, blockdev, chardev, crypto, gpiodev, io, qmp)
common_ss.add(qom, qemuutil)
common_ss.add_all(when: 'CONFIG_SYSTEM_ONLY', if_true: [system_ss])
diff --git a/qemu-options.hx b/qemu-options.hx
index dc694a99a30a7d1ef1567005f59ece88d13f3455..97d293c7d3276a5835c40bb9b26e5f0c8c2a2d28 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -4081,6 +4081,15 @@ ERST
DEFHEADING()
+DEFHEADING(GPIO device options:)
+
+DEF("gpiodev", HAS_ARG, QEMU_OPTION_gpiodev,
+ "-gpiodev help\n"
+ , QEMU_ARCH_ALL
+)
+
+DEFHEADING()
+
#ifdef CONFIG_TPM
DEFHEADING(TPM device options:)
diff --git a/system/vl.c b/system/vl.c
index 04f78466c412a2f9e38c0b187c45d09d8df873ce..67e266a93d0d53c2a7cbd49f8831ae85702c8b42 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -73,6 +73,7 @@
#include "gdbstub/enums.h"
#include "qemu/timer.h"
#include "chardev/char.h"
+#include "gpiodev/gpio.h"
#include "qemu/bitmap.h"
#include "qemu/log.h"
#include "system/blockdev.h"
@@ -1230,6 +1231,20 @@ static int chardev_init_func(void *opaque, QemuOpts *opts, Error **errp)
return 0;
}
+static int gpiodev_init_func(void *opaque, QemuOpts *opts, Error **errp)
+{
+ Error *local_err = NULL;
+
+ if (!qemu_gpiodev_add(opts, NULL, &local_err)) {
+ if (local_err) {
+ error_propagate(errp, local_err);
+ return -1;
+ }
+ exit(0);
+ }
+ return 0;
+}
+
#ifdef CONFIG_VIRTFS
static int fsdev_init_func(void *opaque, QemuOpts *opts, Error **errp)
{
@@ -2053,6 +2068,9 @@ static void qemu_create_early_backends(void)
qemu_opts_foreach(qemu_find_opts("chardev"),
chardev_init_func, NULL, &error_fatal);
+ qemu_opts_foreach(qemu_find_opts("gpiodev"),
+ gpiodev_init_func, NULL, &error_fatal);
+
#ifdef CONFIG_VIRTFS
qemu_opts_foreach(qemu_find_opts("fsdev"),
fsdev_init_func, NULL, &error_fatal);
@@ -3241,6 +3259,13 @@ void qemu_init(int argc, char **argv)
exit(1);
}
break;
+ case QEMU_OPTION_gpiodev:
+ opts = qemu_opts_parse_noisily(qemu_find_opts("gpiodev"),
+ optarg, true);
+ if (!opts) {
+ exit(1);
+ }
+ break;
case QEMU_OPTION_fsdev:
olist = qemu_find_opts("fsdev");
if (!olist) {
--
2.45.2
WARNING: multiple messages have this Message-ID (diff)
From: Nikita Shubin via B4 Relay <devnull+n.shubin.yadro.com@kernel.org>
To: qemu-devel@nongnu.org
Cc: "Linus Walleij" <linus.walleij@linaro.org>,
"Bartosz Golaszewski" <brgl@bgdev.pl>,
"Enrico Weigelt, metux IT consult" <info@metux.net>,
"Viresh Kumar" <vireshk@kernel.org>,
"Eric Blake" <eblake@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Michael Roth" <michael.roth@amd.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Cédric Le Goater" <clg@kaod.org>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Steven Lee" <steven_lee@aspeedtech.com>,
"Troy Lee" <leetroy@gmail.com>,
"Jamin Lin" <jamin_lin@aspeedtech.com>,
"Andrew Jeffery" <andrew@codeconstruct.com.au>,
"Joel Stanley" <joel@jms.id.au>,
qemu-arm@nongnu.org, "Nikita Shubin" <nikita.shubin@maquefel.me>,
"Nikita Shubin" <n.shubin@yadro.com>
Subject: [PATCH PoC 2/7] Add gpiodev dummy
Date: Wed, 19 Mar 2025 10:57:52 +0300 [thread overview]
Message-ID: <20250319-gpiodev-v1-2-76da4e5800a1@yadro.com> (raw)
In-Reply-To: <20250319-gpiodev-v1-0-76da4e5800a1@yadro.com>
From: Nikita Shubin <n.shubin@yadro.com>
Add gpiodev stub with single help option.
Signed-off-by: Nikita Shubin <n.shubin@yadro.com>
---
gpiodev/gpio.c | 145 +++++++++++++++++++++++++++++++++++++++++++++++++
gpiodev/meson.build | 5 ++
include/gpiodev/gpio.h | 34 ++++++++++++
meson.build | 11 +++-
qemu-options.hx | 9 +++
system/vl.c | 25 +++++++++
6 files changed, 228 insertions(+), 1 deletion(-)
diff --git a/gpiodev/gpio.c b/gpiodev/gpio.c
new file mode 100644
index 0000000000000000000000000000000000000000..0f84fb6c502bd6d0a5f808bc299fabd4144c2909
--- /dev/null
+++ b/gpiodev/gpio.c
@@ -0,0 +1,145 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * QEMU GPIO device.
+ *
+ * Author: 2025 Nikita Shubin <n.shubin@yadro.com>
+ *
+ */
+#include "qemu/osdep.h"
+
+#include "qapi/error.h"
+#include "qemu/config-file.h"
+#include "qemu/option.h"
+#include "qemu/qemu-print.h"
+#include "qemu/help_option.h"
+
+#include "gpiodev/gpio.h"
+
+static Object *get_gpiodevs_root(void)
+{
+ return object_get_container("gpiodevs");
+}
+
+static const TypeInfo gpiodev_types_info[] = {
+ {
+ .name = TYPE_GPIODEV,
+ .parent = TYPE_OBJECT,
+ .instance_size = sizeof(Gpiodev),
+ .abstract = true,
+ },
+};
+
+DEFINE_TYPES(gpiodev_types_info);
+
+static Gpiodev *gpiodev_new(const char *id,
+ GMainContext *gcontext,
+ Error **errp)
+{
+ Object *obj;
+ Gpiodev *gpio = NULL;
+
+ assert(id);
+
+ obj = object_new(TYPE_GPIODEV);
+ gpio = GPIODEV(obj);
+ gpio->gcontext = gcontext;
+
+ return gpio;
+}
+
+static Gpiodev *qemu_gpiodev_new(const char *id,
+ GMainContext *gcontext,
+ Error **errp)
+{
+ Gpiodev *gpio;
+
+ gpio = gpiodev_new(id, gcontext, errp);
+ if (!gpio) {
+ return NULL;
+ }
+
+ if (!object_property_try_add_child(get_gpiodevs_root(), id, OBJECT(gpio),
+ errp)) {
+ object_unref(OBJECT(gpio));
+ return NULL;
+ }
+
+ object_unref(OBJECT(gpio));
+
+ return gpio;
+}
+
+typedef struct GpiodevClassFE {
+ void (*fn)(const char *name, void *opaque);
+ void *opaque;
+} GpiodevClassFE;
+
+static void
+gpiodev_class_foreach(ObjectClass *klass, void *opaque)
+{
+ GpiodevClassFE *fe = opaque;
+
+ assert(g_str_has_prefix(object_class_get_name(klass), "gpiodev-"));
+ fe->fn(object_class_get_name(klass) + 8, fe->opaque);
+}
+
+static void
+gpiodev_name_foreach(void (*fn)(const char *name, void *opaque),
+ void *opaque)
+{
+ GpiodevClassFE fe = { .fn = fn, .opaque = opaque };
+
+ object_class_foreach(gpiodev_class_foreach, TYPE_GPIODEV, false, &fe);
+}
+
+static void
+help_string_append(const char *name, void *opaque)
+{
+ GString *str = opaque;
+
+ g_string_append_printf(str, "\n %s", name);
+}
+
+Gpiodev *qemu_gpiodev_add(QemuOpts *opts, GMainContext *context,
+ Error **errp)
+{
+ const char *id = qemu_opts_id(opts);
+ const char *name = qemu_opt_get(opts, "backend");
+
+ if (name && is_help_option(name)) {
+ GString *str = g_string_new("");
+
+ gpiodev_name_foreach(help_string_append, str);
+
+ qemu_printf("Available chardev backend types: %s\n", str->str);
+ g_string_free(str, true);
+ return NULL;
+ }
+
+ if (id == NULL) {
+ error_setg(errp, "gpiodev: no id specified");
+ return NULL;
+ }
+
+ return qemu_gpiodev_new(id, context, errp);
+}
+
+static QemuOptsList qemu_gpiodev_opts = {
+ .name = "gpiodev",
+ .implied_opt_name = "backend",
+ .head = QTAILQ_HEAD_INITIALIZER(qemu_gpiodev_opts.head),
+ .desc = {
+ {
+ .name = "backend",
+ .type = QEMU_OPT_STRING,
+ },
+ { /* end of list */ }
+ },
+};
+
+static void gpiodev_register_config(void)
+{
+ qemu_add_opts(&qemu_gpiodev_opts);
+}
+
+opts_init(gpiodev_register_config);
diff --git a/gpiodev/meson.build b/gpiodev/meson.build
new file mode 100644
index 0000000000000000000000000000000000000000..05aeb266bce8d905753d90d917b5f8b2d265a0cf
--- /dev/null
+++ b/gpiodev/meson.build
@@ -0,0 +1,5 @@
+gpiodev_ss.add(files(
+ 'gpio.c',
+))
+
+gpiodev_ss = gpiodev_ss.apply({})
diff --git a/include/gpiodev/gpio.h b/include/gpiodev/gpio.h
new file mode 100644
index 0000000000000000000000000000000000000000..aca0a6090bb5264e1646fa5facace2d8f7cc47fd
--- /dev/null
+++ b/include/gpiodev/gpio.h
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * QEMU GPIO device.
+ *
+ * Author: 2025 Nikita Shubin <n.shubin@yadro.com>
+ *
+ */
+#ifndef QEMU_GPIO_H
+#define QEMU_GPIO_H
+
+#include "qom/object.h"
+
+/* gpio back-end device */
+typedef struct GpioBackend GpioBackend;
+
+struct Gpiodev {
+ Object parent_obj;
+
+ GpioBackend *be;
+
+ GMainContext *gcontext;
+};
+
+struct GpiodevClass {
+ ObjectClass parent_class;
+};
+
+#define TYPE_GPIODEV "gpiodev"
+OBJECT_DECLARE_TYPE(Gpiodev, GpiodevClass, GPIODEV)
+
+Gpiodev *qemu_gpiodev_add(QemuOpts *opts, GMainContext *context,
+ Error **errp);
+
+#endif /* QEMU_GPIO_H */
diff --git a/meson.build b/meson.build
index 8b9fda4d95e634e6faa8db5604e5e0ddc4b1eb9e..9daac5783bcf459a3ee6ff1e999582bf4e9a47cc 100644
--- a/meson.build
+++ b/meson.build
@@ -3646,6 +3646,7 @@ block_ss = ss.source_set()
chardev_ss = ss.source_set()
common_ss = ss.source_set()
crypto_ss = ss.source_set()
+gpiodev_ss = ss.source_set()
hwcore_ss = ss.source_set()
io_ss = ss.source_set()
qmp_ss = ss.source_set()
@@ -3735,6 +3736,7 @@ subdir('io')
subdir('chardev')
subdir('fsdev')
subdir('dump')
+subdir('gpiodev')
if have_block
block_ss.add(files(
@@ -4023,11 +4025,18 @@ libhwcore = static_library('hwcore', sources: hwcore_ss.sources() + genh,
hwcore = declare_dependency(objects: libhwcore.extract_all_objects(recursive: false))
common_ss.add(hwcore)
+libgpiodev = static_library('gpiodev', gpiodev_ss.sources() + genh,
+ dependencies: gpiodev_ss.dependencies(),
+ build_by_default: false)
+
+gpiodev = declare_dependency(objects: libgpiodev.extract_all_objects(recursive: false),
+ dependencies: gpiodev_ss.dependencies())
+
###########
# Targets #
###########
-system_ss.add(authz, blockdev, chardev, crypto, io, qmp)
+system_ss.add(authz, blockdev, chardev, crypto, gpiodev, io, qmp)
common_ss.add(qom, qemuutil)
common_ss.add_all(when: 'CONFIG_SYSTEM_ONLY', if_true: [system_ss])
diff --git a/qemu-options.hx b/qemu-options.hx
index dc694a99a30a7d1ef1567005f59ece88d13f3455..97d293c7d3276a5835c40bb9b26e5f0c8c2a2d28 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -4081,6 +4081,15 @@ ERST
DEFHEADING()
+DEFHEADING(GPIO device options:)
+
+DEF("gpiodev", HAS_ARG, QEMU_OPTION_gpiodev,
+ "-gpiodev help\n"
+ , QEMU_ARCH_ALL
+)
+
+DEFHEADING()
+
#ifdef CONFIG_TPM
DEFHEADING(TPM device options:)
diff --git a/system/vl.c b/system/vl.c
index 04f78466c412a2f9e38c0b187c45d09d8df873ce..67e266a93d0d53c2a7cbd49f8831ae85702c8b42 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -73,6 +73,7 @@
#include "gdbstub/enums.h"
#include "qemu/timer.h"
#include "chardev/char.h"
+#include "gpiodev/gpio.h"
#include "qemu/bitmap.h"
#include "qemu/log.h"
#include "system/blockdev.h"
@@ -1230,6 +1231,20 @@ static int chardev_init_func(void *opaque, QemuOpts *opts, Error **errp)
return 0;
}
+static int gpiodev_init_func(void *opaque, QemuOpts *opts, Error **errp)
+{
+ Error *local_err = NULL;
+
+ if (!qemu_gpiodev_add(opts, NULL, &local_err)) {
+ if (local_err) {
+ error_propagate(errp, local_err);
+ return -1;
+ }
+ exit(0);
+ }
+ return 0;
+}
+
#ifdef CONFIG_VIRTFS
static int fsdev_init_func(void *opaque, QemuOpts *opts, Error **errp)
{
@@ -2053,6 +2068,9 @@ static void qemu_create_early_backends(void)
qemu_opts_foreach(qemu_find_opts("chardev"),
chardev_init_func, NULL, &error_fatal);
+ qemu_opts_foreach(qemu_find_opts("gpiodev"),
+ gpiodev_init_func, NULL, &error_fatal);
+
#ifdef CONFIG_VIRTFS
qemu_opts_foreach(qemu_find_opts("fsdev"),
fsdev_init_func, NULL, &error_fatal);
@@ -3241,6 +3259,13 @@ void qemu_init(int argc, char **argv)
exit(1);
}
break;
+ case QEMU_OPTION_gpiodev:
+ opts = qemu_opts_parse_noisily(qemu_find_opts("gpiodev"),
+ optarg, true);
+ if (!opts) {
+ exit(1);
+ }
+ break;
case QEMU_OPTION_fsdev:
olist = qemu_find_opts("fsdev");
if (!olist) {
--
2.45.2
next prev parent reply other threads:[~2025-03-19 7:57 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-19 7:57 [PATCH PoC 0/7] Interact with QEMU GPIO models via gpiodev Nikita Shubin
2025-03-19 7:57 ` Nikita Shubin via B4 Relay
2025-03-19 7:57 ` [PATCH PoC 1/7] QAPI: gpio JSON Nikita Shubin
2025-03-19 7:57 ` Nikita Shubin via B4 Relay
2025-03-19 11:24 ` Daniel P. Berrangé
2025-04-09 6:42 ` Markus Armbruster
2025-03-19 7:57 ` Nikita Shubin [this message]
2025-03-19 7:57 ` [PATCH PoC 2/7] Add gpiodev dummy Nikita Shubin via B4 Relay
2025-03-19 7:57 ` [PATCH PoC 3/7] gpiodev: Add GPIO device frontend Nikita Shubin
2025-03-19 7:57 ` Nikita Shubin via B4 Relay
2025-03-19 7:57 ` [PATCH PoC 4/7] gpiodev: Add GPIO backend over chardev Nikita Shubin
2025-03-19 7:57 ` Nikita Shubin via B4 Relay
2025-03-19 7:57 ` [PATCH PoC 5/7] hw/gpio/aspeed: Add gpiodev support Nikita Shubin
2025-03-19 7:57 ` Nikita Shubin via B4 Relay
2025-03-19 7:57 ` [PATCH PoC 6/7] hw/arm: ast2600: set id for gpio Nikita Shubin
2025-03-19 7:57 ` Nikita Shubin via B4 Relay
2025-03-19 7:57 ` [PATCH PoC 7/7] gpiodev: Add gpiobackend over GUSE Nikita Shubin
2025-03-19 7:57 ` Nikita Shubin via B4 Relay
2025-04-09 6:56 ` Markus Armbruster
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=20250319-gpiodev-v1-2-76da4e5800a1@yadro.com \
--to=n.shubin@yadro.com \
--cc=andrew@codeconstruct.com.au \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=brgl@bgdev.pl \
--cc=clg@kaod.org \
--cc=eblake@redhat.com \
--cc=eduardo@habkost.net \
--cc=info@metux.net \
--cc=jamin_lin@aspeedtech.com \
--cc=joel@jms.id.au \
--cc=leetroy@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=marcandre.lureau@redhat.com \
--cc=michael.roth@amd.com \
--cc=nikita.shubin@maquefel.me \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=steven_lee@aspeedtech.com \
--cc=vireshk@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.