[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 12/13] char: Remove qemu_chr_parse_opts()
From: |
Kevin Wolf |
Subject: |
[PATCH 12/13] char: Remove qemu_chr_parse_opts() |
Date: |
Thu, 12 Nov 2020 18:59:04 +0100 |
The function is unused now, remove it.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
include/chardev/char.h | 10 ----------
chardev/char.c | 37 -------------------------------------
2 files changed, 47 deletions(-)
diff --git a/include/chardev/char.h b/include/chardev/char.h
index 5cd46207f6..761c521bd8 100644
--- a/include/chardev/char.h
+++ b/include/chardev/char.h
@@ -146,16 +146,6 @@ void qemu_chr_translate_legacy_options(QDict *args);
*/
void qemu_chr_parse_common(QemuOpts *opts, ChardevCommon *backend);
-/**
- * qemu_chr_parse_opts:
- *
- * Parse the options to the ChardevBackend struct.
- *
- * Returns: a new backend or NULL on error
- */
-ChardevBackend *qemu_chr_parse_opts(QemuOpts *opts,
- Error **errp);
-
/**
* qemu_chr_new:
* @label: the name of the backend
diff --git a/chardev/char.c b/chardev/char.c
index 4a444a0353..c3cfd473b4 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -610,43 +610,6 @@ static const char *chardev_alias_translate(const char
*name)
return name;
}
-ChardevBackend *qemu_chr_parse_opts(QemuOpts *opts, Error **errp)
-{
- Error *local_err = NULL;
- const ChardevClass *cc;
- ChardevBackend *backend = NULL;
- const char *name = chardev_alias_translate(qemu_opt_get(opts, "backend"));
-
- if (name == NULL) {
- error_setg(errp, "chardev: \"%s\" missing backend",
- qemu_opts_id(opts));
- return NULL;
- }
-
- cc = char_get_class(name, errp);
- if (cc == NULL) {
- return NULL;
- }
-
- backend = g_new0(ChardevBackend, 1);
- backend->type = CHARDEV_BACKEND_KIND_NULL;
-
- if (cc->parse) {
- cc->parse(opts, backend, &local_err);
- if (local_err) {
- error_propagate(errp, local_err);
- qapi_free_ChardevBackend(backend);
- return NULL;
- }
- } else {
- ChardevCommon *ccom = g_new0(ChardevCommon, 1);
- qemu_chr_parse_common(opts, ccom);
- backend->u.null.data = ccom; /* Any ChardevCommon member would work */
- }
-
- return backend;
-}
-
void qemu_chr_print_types(void)
{
g_autoptr(GString) str = g_string_new("");
--
2.28.0
- [PATCH 06/13] char-udp: Implement compat code for CLI QAPIfication, (continued)
- [PATCH 09/13] qemu-storage-daemon: QAPIfy --chardev, Kevin Wolf, 2020/11/12
- [PATCH 10/13] char: Implement qemu_chr_new_from_opts() in terms of QAPI, Kevin Wolf, 2020/11/12
- [PATCH 11/13] hmp/char: Use qemu_chr_parse_cli_str() for chardev-change, Kevin Wolf, 2020/11/12
- [PATCH 12/13] char: Remove qemu_chr_parse_opts(),
Kevin Wolf <=
- [PATCH 13/13] char: Remove ChardevClass.parse, Kevin Wolf, 2020/11/12