qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH] net: Allow specifying maximum number of network NIC


From: Shmulik Ladkani
Subject: [Qemu-devel] [PATCH] net: Allow specifying maximum number of network NICs during configure
Date: Sat, 20 Jun 2015 14:26:29 +0300

Currently, MAX_NICS is hardcoded as 8.

Add a configuration option '--net-max-nics' so one can override the
default.
Unless specified, default value is kept as 8.

Signed-off-by: Shmulik Ladkani <address@hidden>
---
 configure         | 7 +++++++
 include/net/net.h | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 222694f34d..ce859a1853 100755
--- a/configure
+++ b/configure
@@ -336,6 +336,7 @@ vhdx=""
 quorum=""
 numa=""
 tcmalloc="no"
+net_max_nics="8"
 
 # parse CC options first
 for opt do
@@ -1147,6 +1148,8 @@ for opt do
   ;;
   --enable-tcmalloc) tcmalloc="yes"
   ;;
+  --net-max-nics=*) net_max_nics="$optarg"
+  ;;
   *)
       echo "ERROR: unknown option $opt"
       echo "Try '$0 --help' for more information"
@@ -1420,6 +1423,7 @@ Advanced options (experts only):
   --enable-numa            enable libnuma support
   --disable-tcmalloc       disable tcmalloc support
   --enable-tcmalloc        enable tcmalloc support
+  --net-max-nics=NUM       maximum number of network NICs
 
 NOTE: The object files are built at the place where configure is launched
 EOF
@@ -4499,6 +4503,7 @@ echo "snappy support    $snappy"
 echo "bzip2 support     $bzip2"
 echo "NUMA host support $numa"
 echo "tcmalloc support  $tcmalloc"
+echo "maximum network nics $net_max_nics"
 
 if test "$sdl_too_old" = "yes"; then
 echo "-> Your SDL version is too old - please upgrade to have SDL support"
@@ -5011,6 +5016,8 @@ if test "$rdma" = "yes" ; then
   echo "CONFIG_RDMA=y" >> $config_host_mak
 fi
 
+echo "CONFIG_NET_MAX_NICS=$net_max_nics" >> $config_host_mak
+
 # Hold two types of flag:
 #   CONFIG_THREAD_SETNAME_BYTHREAD  - we've got a way of setting the name on
 #                                     a thread we have a handle to
diff --git a/include/net/net.h b/include/net/net.h
index 4306252b97..6be063f1dc 100644
--- a/include/net/net.h
+++ b/include/net/net.h
@@ -167,7 +167,7 @@ void hmp_info_network(Monitor *mon, const QDict *qdict);
 
 /* NIC info */
 
-#define MAX_NICS 8
+#define MAX_NICS (CONFIG_NET_MAX_NICS)
 
 struct NICInfo {
     MACAddr macaddr;
-- 
1.9.1




reply via email to

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