[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V5 05/18] monitor: replace the magic number 255 with
From: |
Jason Wang |
Subject: |
[Qemu-devel] [PATCH V5 05/18] monitor: replace the magic number 255 with MAX_QUEUE_NUM |
Date: |
Wed, 1 Apr 2015 16:14:59 +0800 |
This patch replace the magic number 255, and increase it to
MAX_QUEUE_NUM which is maximum number of queues supported by a nic.
Cc: Luiz Capitulino <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
---
monitor.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/monitor.c b/monitor.c
index 68873ec..a039edf 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4472,10 +4472,11 @@ void set_link_completion(ReadLineState *rs, int
nb_args, const char *str)
len = strlen(str);
readline_set_completion_index(rs, len);
if (nb_args == 2) {
- NetClientState *ncs[255];
+ NetClientState *ncs[MAX_QUEUE_NUM];
int count, i;
count = qemu_find_net_clients_except(NULL, ncs,
- NET_CLIENT_OPTIONS_KIND_NONE,
255);
+ NET_CLIENT_OPTIONS_KIND_NONE,
+ MAX_QUEUE_NUM);
for (i = 0; i < count; i++) {
const char *name = ncs[i]->name;
if (!strncmp(str, name, len)) {
@@ -4491,7 +4492,7 @@ void set_link_completion(ReadLineState *rs, int nb_args,
const char *str)
void netdev_del_completion(ReadLineState *rs, int nb_args, const char *str)
{
int len, count, i;
- NetClientState *ncs[255];
+ NetClientState *ncs[MAX_QUEUE_NUM];
if (nb_args != 2) {
return;
@@ -4500,7 +4501,7 @@ void netdev_del_completion(ReadLineState *rs, int
nb_args, const char *str)
len = strlen(str);
readline_set_completion_index(rs, len);
count = qemu_find_net_clients_except(NULL, ncs,
NET_CLIENT_OPTIONS_KIND_NIC,
- 255);
+ MAX_QUEUE_NUM);
for (i = 0; i < count; i++) {
QemuOpts *opts;
const char *name = ncs[i]->name;
@@ -4566,14 +4567,15 @@ void host_net_add_completion(ReadLineState *rs, int
nb_args, const char *str)
void host_net_remove_completion(ReadLineState *rs, int nb_args, const char
*str)
{
- NetClientState *ncs[255];
+ 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_OPTIONS_KIND_NONE,
255);
+ NET_CLIENT_OPTIONS_KIND_NONE,
+ MAX_QUEUE_NUM);
for (i = 0; i < count; i++) {
int id;
char name[16];
@@ -4589,7 +4591,8 @@ void host_net_remove_completion(ReadLineState *rs, int
nb_args, const char *str)
return;
} else if (nb_args == 3) {
count = qemu_find_net_clients_except(NULL, ncs,
- NET_CLIENT_OPTIONS_KIND_NIC, 255);
+ NET_CLIENT_OPTIONS_KIND_NIC,
+ MAX_QUEUE_NUM);
for (i = 0; i < count; i++) {
int id;
const char *name;
--
2.1.0
- [Qemu-devel] [PATCH V5 00/18] Support more virtio queues, Jason Wang, 2015/04/01
- [Qemu-devel] [PATCH V5 01/18] virtio-net: fix the upper bound when trying to delete queues, Jason Wang, 2015/04/01
- [Qemu-devel] [PATCH V5 02/18] pc: add 2.4 machine types, Jason Wang, 2015/04/01
- [Qemu-devel] [PATCH V5 03/18] spapr: add machine type specific instance init function, Jason Wang, 2015/04/01
- [Qemu-devel] [PATCH V5 04/18] ppc: spapr: add 2.4 machine type, Jason Wang, 2015/04/01
- [Qemu-devel] [PATCH V5 06/18] monitor: check return value of qemu_find_net_clients_except(), Jason Wang, 2015/04/01
- [Qemu-devel] [PATCH V5 05/18] monitor: replace the magic number 255 with MAX_QUEUE_NUM,
Jason Wang <=
- [Qemu-devel] [PATCH V5 07/18] virtio-ccw: using VIRTIO_NO_VECTOR instead of 0 for invalid virtqueue, Jason Wang, 2015/04/01
- [Qemu-devel] [PATCH V5 08/18] virtio: introduce bus specific queue limit, Jason Wang, 2015/04/01
- [Qemu-devel] [PATCH V5 11/18] virtio-mmio: switch to bus specific queue limit, Jason Wang, 2015/04/01
- [Qemu-devel] [PATCH V5 10/18] virtio-s390: switch to bus specific queue limit, Jason Wang, 2015/04/01
- [Qemu-devel] [PATCH V5 09/18] virtio-ccw: introduce ccw specific queue limit, Jason Wang, 2015/04/01
- [Qemu-devel] [PATCH V5 12/18] virtio-pci: switch to use bus specific queue limit, Jason Wang, 2015/04/01
- [Qemu-devel] [PATCH V5 13/18] virtio: introduce vector to virtqueues mapping, Jason Wang, 2015/04/01
- [Qemu-devel] [PATCH V5 14/18] virtio: introduce virtio_queue_get_index(), Jason Wang, 2015/04/01