qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 19/26] monitor: Move two net functions from monit


From: Benoît Canet
Subject: [Qemu-devel] [PATCH v2 19/26] monitor: Move two net functions from monitor.c to monitor-system.c
Date: Fri, 15 Aug 2014 15:35:51 +0200

With this move the monitor.c/monitor-system.c split is complete.

Signed-off-by: Benoît 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 b908143..436dfad 100644
--- a/monitor-system.c
+++ b/monitor-system.c
@@ -2465,3 +2465,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 1472ef4..ae788f8 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2097,55 +2097,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.1.0.rc1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]