@@ -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);
+ }
+ }
+}
@@ -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) {
With this move the monitor.c/monitor-system.c split is complete. Signed-off-by: Benoit Canet <benoit@irqsave.net> --- monitor-system.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ monitor.c | 49 ------------------------------------------------- 2 files changed, 49 insertions(+), 49 deletions(-)