[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v1 17/24] monitor: Move two net functions from monit
From: |
Benoît Canet |
Subject: |
[Qemu-devel] [PATCH v1 17/24] monitor: Move two net functions from monitor.c to monitor-system.c |
Date: |
Fri, 1 Aug 2014 07:27:15 +0200 |
With this move the monitor.c/monitor-system.c split is complete.
Signed-off-by: Benoit Canet <address@hidden>
---
monitor-system.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
monitor.c | 49 -------------------------------------------------
2 files changed, 49 insertions(+), 49 deletions(-)
diff --git a/monitor-system.c b/monitor-system.c
index f8e4a10..d5abf73 100644
--- a/monitor-system.c
+++ b/monitor-system.c
@@ -2464,3 +2464,52 @@ int monitor_read_block_device_key(Monitor *mon, const
char *device,
return monitor_read_bdrv_key_start(mon, bs, completion_cb, opaque);
}
+
+void set_link_completion(ReadLineState *rs, int nb_args, const char *str)
+{
+ size_t len;
+
+ len = strlen(str);
+ readline_set_completion_index(rs, len);
+ if (nb_args == 2) {
+ NetClientState *ncs[255];
+ int count, i;
+ count = qemu_find_net_clients_except(NULL, ncs,
+ NET_CLIENT_OPTIONS_KIND_NONE,
255);
+ for (i = 0; i < count; i++) {
+ const char *name = ncs[i]->name;
+ if (!strncmp(str, name, len)) {
+ readline_add_completion(rs, name);
+ }
+ }
+ } else if (nb_args == 3) {
+ add_completion_option(rs, str, "on");
+ add_completion_option(rs, str, "off");
+ }
+}
+
+void netdev_del_completion(ReadLineState *rs, int nb_args, const char *str)
+{
+ int len, count, i;
+ NetClientState *ncs[255];
+
+ if (nb_args != 2) {
+ return;
+ }
+
+ len = strlen(str);
+ readline_set_completion_index(rs, len);
+ count = qemu_find_net_clients_except(NULL, ncs,
NET_CLIENT_OPTIONS_KIND_NIC,
+ 255);
+ for (i = 0; i < count; i++) {
+ QemuOpts *opts;
+ const char *name = ncs[i]->name;
+ if (strncmp(str, name, len)) {
+ continue;
+ }
+ opts = qemu_opts_find(qemu_find_opts_err("netdev", NULL), name);
+ if (opts) {
+ readline_add_completion(rs, name);
+ }
+ }
+}
diff --git a/monitor.c b/monitor.c
index 79b54e1..3133f62 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2096,55 +2096,6 @@ void sendkey_completion(ReadLineState *rs, int nb_args,
const char *str)
}
}
-void set_link_completion(ReadLineState *rs, int nb_args, const char *str)
-{
- size_t len;
-
- len = strlen(str);
- readline_set_completion_index(rs, len);
- if (nb_args == 2) {
- NetClientState *ncs[255];
- int count, i;
- count = qemu_find_net_clients_except(NULL, ncs,
- NET_CLIENT_OPTIONS_KIND_NONE,
255);
- for (i = 0; i < count; i++) {
- const char *name = ncs[i]->name;
- if (!strncmp(str, name, len)) {
- readline_add_completion(rs, name);
- }
- }
- } else if (nb_args == 3) {
- add_completion_option(rs, str, "on");
- add_completion_option(rs, str, "off");
- }
-}
-
-void netdev_del_completion(ReadLineState *rs, int nb_args, const char *str)
-{
- int len, count, i;
- NetClientState *ncs[255];
-
- if (nb_args != 2) {
- return;
- }
-
- len = strlen(str);
- readline_set_completion_index(rs, len);
- count = qemu_find_net_clients_except(NULL, ncs,
NET_CLIENT_OPTIONS_KIND_NIC,
- 255);
- for (i = 0; i < count; i++) {
- QemuOpts *opts;
- const char *name = ncs[i]->name;
- if (strncmp(str, name, len)) {
- continue;
- }
- opts = qemu_opts_find(qemu_find_opts_err("netdev", NULL), name);
- if (opts) {
- readline_add_completion(rs, name);
- }
- }
-}
-
void watchdog_action_completion(ReadLineState *rs, int nb_args, const char
*str)
{
if (nb_args != 2) {
--
2.0.1
- [Qemu-devel] [PATCH v1 08/24] monitor: Extract a couple of function to monitor-system.c, (continued)
- [Qemu-devel] [PATCH v1 08/24] monitor: Extract a couple of function to monitor-system.c, Benoît Canet, 2014/08/01
- [Qemu-devel] [PATCH v1 05/24] monitor: Extract monitor_fprintf to monitor-system.c, Benoît Canet, 2014/08/01
- [Qemu-devel] [PATCH v1 22/24] qemu-nbd: build QAPI block core into qemu-nbd, Benoît Canet, 2014/08/01
- [Qemu-devel] [PATCH v1 16/24] monitor: Move more functions from monitor.c to monitor-system.c, Benoît Canet, 2014/08/01
- [Qemu-devel] [PATCH v1 07/24] monitor: Make some function to extract public, Benoît Canet, 2014/08/01
- [Qemu-devel] [PATCH v1 12/24] monitor: Make do_loadvm public before moving it to monitor-system.c, Benoît Canet, 2014/08/01
- [Qemu-devel] [PATCH v1 23/24] qapi: Add a script to filter qmp-commands-old.h to generate a subset of it., Benoît Canet, 2014/08/01
- [Qemu-devel] [PATCH v1 24/24] qemu-nbd: Add --qmp option to qemu-nbd., Benoît Canet, 2014/08/01
- [Qemu-devel] [PATCH v1 10/24] monitor: Extract do_info_help in monitor-system.c, Benoît Canet, 2014/08/01
- [Qemu-devel] [PATCH v1 17/24] monitor: Move two net functions from monitor.c to monitor-system.c,
Benoît Canet <=
- [Qemu-devel] [PATCH v1 18/24] monitor: Move qmp_rtc_reset_reinjection from monitor.c to monitor-system.c, Benoît Canet, 2014/08/01
- [Qemu-devel] [PATCH v1 19/24] monitor-system: Switch back functions to static, Benoît Canet, 2014/08/01
- [Qemu-devel] [PATCH v1 14/24] monitor: Make commands public before moving them to monitor-system.c, Benoît Canet, 2014/08/01
- [Qemu-devel] [PATCH v1 21/24] monitor: Cleanup monitor.c includes after extracting monitor-system.c, Benoît Canet, 2014/08/01
- [Qemu-devel] [PATCH v1 20/24] monitor: Extract hardware dependent completion function from monitor.c to monitor-system.c, Benoît Canet, 2014/08/01
- [Qemu-devel] [PATCH v1 15/24] monitor: Move mon_cmd_t arrays and some function from monitor.c to monitor-system.c, Benoît Canet, 2014/08/01
- [Qemu-devel] [PATCH v1 11/24] monitor: Make some monitor functions public before moving them in monitor-system.c, Benoît Canet, 2014/08/01