mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1 iQEcBAABAgAGBQJanLRTAAoJEO8Ells5jWIRAxsH/3wX62o+msLjJHakjcu2OTMG vdhnB8GfjC5HgMYbovG7TJ95KXg7VRodwru9zgJheTK7DG8fG0nFRuzr8L2tSAph 3s0YTFYDXJ6MBYD//ubdX+jNnchIvMlTX6yheAzcXvQb+nCcN2efN0XpSlGR+g4D wGi1lWKurGEJE6RUfYPpbbUkjXjbbKyclE0RL+WBmmyruerXI8OxuXQ3GuHK75fb cZLiToyP9+qnnDyT4lceG5vGRjYLtL8t1nB01M4UTr+tlCkMMsoOjufzGB/CDUdm oGi1OuKRw06xTLroUJ/uiwSKQH6dMbrv6sLvk92dHnL9k2ZAjv2bVAgz8eAG7o0= =pPIZ -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging # gpg: Signature made Mon 05 Mar 2018 03:06:59 GMT # gpg: using RSA key EF04965B398D6211 # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 215D 46F4 8246 689E C77F 3562 EF04 965B 398D 6211 * remotes/jasowang/tags/net-pull-request: tap: setting error appropriately when calling net_init_tap_one() hw/net: Remove unnecessary header includes net: Add a new convenience option "--nic" to configure default/on-board NICs net: Remove the deprecated 'host_net_add' and 'host_net_remove' HMP commands net: Remove the deprecated way of dumping network packets net: Make net_client_init() static net: Only show vhost-user in the help text if CONFIG_POSIX is defined net: List available netdevs with "-netdev help" net: Move error reporting from net_init_client/netdev to the calling site Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
41dfc0dc55
21 changed files with 190 additions and 391 deletions
61
monitor.c
61
monitor.c
|
@ -3581,67 +3581,6 @@ void migrate_set_parameter_completion(ReadLineState *rs, int nb_args,
|
|||
}
|
||||
}
|
||||
|
||||
void host_net_add_completion(ReadLineState *rs, int nb_args, const char *str)
|
||||
{
|
||||
int i;
|
||||
size_t len;
|
||||
if (nb_args != 2) {
|
||||
return;
|
||||
}
|
||||
len = strlen(str);
|
||||
readline_set_completion_index(rs, len);
|
||||
for (i = 0; host_net_devices[i]; i++) {
|
||||
if (!strncmp(host_net_devices[i], str, len)) {
|
||||
readline_add_completion(rs, host_net_devices[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void host_net_remove_completion(ReadLineState *rs, int nb_args, const char *str)
|
||||
{
|
||||
NetClientState *ncs[MAX_QUEUE_NUM];
|
||||
int count, i, len;
|
||||
|
||||
len = strlen(str);
|
||||
readline_set_completion_index(rs, len);
|
||||
if (nb_args == 2) {
|
||||
count = qemu_find_net_clients_except(NULL, ncs,
|
||||
NET_CLIENT_DRIVER_NONE,
|
||||
MAX_QUEUE_NUM);
|
||||
for (i = 0; i < MIN(count, MAX_QUEUE_NUM); i++) {
|
||||
int id;
|
||||
char name[16];
|
||||
|
||||
if (net_hub_id_for_client(ncs[i], &id)) {
|
||||
continue;
|
||||
}
|
||||
snprintf(name, sizeof(name), "%d", id);
|
||||
if (!strncmp(str, name, len)) {
|
||||
readline_add_completion(rs, name);
|
||||
}
|
||||
}
|
||||
return;
|
||||
} else if (nb_args == 3) {
|
||||
count = qemu_find_net_clients_except(NULL, ncs,
|
||||
NET_CLIENT_DRIVER_NIC,
|
||||
MAX_QUEUE_NUM);
|
||||
for (i = 0; i < MIN(count, MAX_QUEUE_NUM); i++) {
|
||||
int id;
|
||||
const char *name;
|
||||
|
||||
if (ncs[i]->info->type == NET_CLIENT_DRIVER_HUBPORT ||
|
||||
net_hub_id_for_client(ncs[i], &id)) {
|
||||
continue;
|
||||
}
|
||||
name = ncs[i]->name;
|
||||
if (!strncmp(str, name, len)) {
|
||||
readline_add_completion(rs, name);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static void vm_completion(ReadLineState *rs, const char *str)
|
||||
{
|
||||
size_t len;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue