From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40402) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIHgr-0001vJ-34 for qemu-devel@nongnu.org; Fri, 15 Aug 2014 09:37:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XIHgg-00066a-CK for qemu-devel@nongnu.org; Fri, 15 Aug 2014 09:37:08 -0400 Received: from lputeaux-656-01-25-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:42480 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIHgg-000651-17 for qemu-devel@nongnu.org; Fri, 15 Aug 2014 09:36:58 -0400 From: =?UTF-8?q?Beno=C3=AEt=20Canet?= Date: Fri, 15 Aug 2014 15:35:51 +0200 Message-Id: <1408109759-1100-20-git-send-email-benoit.canet@nodalink.com> In-Reply-To: <1408109759-1100-1-git-send-email-benoit.canet@nodalink.com> References: <1408109759-1100-1-git-send-email-benoit.canet@nodalink.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v2 19/26] monitor: Move two net functions from monitor.c to monitor-system.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, =?UTF-8?q?Beno=C3=AEt=20Canet?= , stefanha@redhat.com With this move the monitor.c/monitor-system.c split is complete. Signed-off-by: Beno=C3=AEt Canet --- 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, co= nst char *device, =20 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 =3D strlen(str); + readline_set_completion_index(rs, len); + if (nb_args =3D=3D 2) { + NetClientState *ncs[255]; + int count, i; + count =3D qemu_find_net_clients_except(NULL, ncs, + NET_CLIENT_OPTIONS_KIND_NON= E, 255); + for (i =3D 0; i < count; i++) { + const char *name =3D ncs[i]->name; + if (!strncmp(str, name, len)) { + readline_add_completion(rs, name); + } + } + } else if (nb_args =3D=3D 3) { + add_completion_option(rs, str, "on"); + add_completion_option(rs, str, "off"); + } +} + +void netdev_del_completion(ReadLineState *rs, int nb_args, const char *s= tr) +{ + int len, count, i; + NetClientState *ncs[255]; + + if (nb_args !=3D 2) { + return; + } + + len =3D strlen(str); + readline_set_completion_index(rs, len); + count =3D qemu_find_net_clients_except(NULL, ncs, NET_CLIENT_OPTIONS= _KIND_NIC, + 255); + for (i =3D 0; i < count; i++) { + QemuOpts *opts; + const char *name =3D ncs[i]->name; + if (strncmp(str, name, len)) { + continue; + } + opts =3D 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) } } =20 -void set_link_completion(ReadLineState *rs, int nb_args, const char *str= ) -{ - size_t len; - - len =3D strlen(str); - readline_set_completion_index(rs, len); - if (nb_args =3D=3D 2) { - NetClientState *ncs[255]; - int count, i; - count =3D qemu_find_net_clients_except(NULL, ncs, - NET_CLIENT_OPTIONS_KIND_NON= E, 255); - for (i =3D 0; i < count; i++) { - const char *name =3D ncs[i]->name; - if (!strncmp(str, name, len)) { - readline_add_completion(rs, name); - } - } - } else if (nb_args =3D=3D 3) { - add_completion_option(rs, str, "on"); - add_completion_option(rs, str, "off"); - } -} - -void netdev_del_completion(ReadLineState *rs, int nb_args, const char *s= tr) -{ - int len, count, i; - NetClientState *ncs[255]; - - if (nb_args !=3D 2) { - return; - } - - len =3D strlen(str); - readline_set_completion_index(rs, len); - count =3D qemu_find_net_clients_except(NULL, ncs, NET_CLIENT_OPTIONS= _KIND_NIC, - 255); - for (i =3D 0; i < count; i++) { - QemuOpts *opts; - const char *name =3D ncs[i]->name; - if (strncmp(str, name, len)) { - continue; - } - opts =3D 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 ch= ar *str) { if (nb_args !=3D 2) { --=20 2.1.0.rc1