aboutsummaryrefslogtreecommitdiff
path: root/include/qapi
diff options
context:
space:
mode:
authorAlexey Kirillov <lekiravi@yandex-team.ru>2021-03-03 12:59:09 +0300
committerJason Wang <jasowang@redhat.com>2021-03-15 16:41:22 +0800
commita0724776c5a98a08fc946bb5a4ad16410ca64c0e (patch)
tree91c98dcf9fa6d9a2497e2133f4f6dcb73c4640c7 /include/qapi
parent59b5437eb732d6b103a9bc279c3482c834d1eff9 (diff)
downloadqemu-a0724776c5a98a08fc946bb5a4ad16410ca64c0e.zip
qemu-a0724776c5a98a08fc946bb5a4ad16410ca64c0e.tar.gz
qemu-a0724776c5a98a08fc946bb5a4ad16410ca64c0e.tar.bz2
hmp: Use QAPI NetdevInfo in hmp_info_network
Replace usage of legacy field info_str of NetClientState for backend network devices with QAPI NetdevInfo stored_config that already used in QMP query-netdev. This change increases the detail of the "info network" output and takes a more general approach to composing the output. NIC and hubports still use legacy info_str field. Signed-off-by: Alexey Kirillov <lekiravi@yandex-team.ru> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'include/qapi')
-rw-r--r--include/qapi/hmp-output-visitor.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/qapi/hmp-output-visitor.h b/include/qapi/hmp-output-visitor.h
new file mode 100644
index 0000000..541e400
--- /dev/null
+++ b/include/qapi/hmp-output-visitor.h
@@ -0,0 +1,30 @@
+/*
+ * HMP string output Visitor
+ *
+ * Copyright Yandex N.V., 2021
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+
+#ifndef HMP_OUTPUT_VISITOR_H
+#define HMP_OUTPUT_VISITOR_H
+
+#include "qapi/visitor.h"
+
+typedef struct HMPOutputVisitor HMPOutputVisitor;
+
+/**
+ * Create a HMP string output visitor for @obj
+ *
+ * Flattens dicts/structures, only shows arrays borders.
+ *
+ * Errors are not expected to happen.
+ *
+ * The caller is responsible for freeing the visitor with
+ * visit_free().
+ */
+Visitor *hmp_output_visitor_new(char **result);
+
+#endif