qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] net: Allow specifying maximum number of network NICs during configure
@ 2015-06-20 11:26 Shmulik Ladkani
  2015-06-22 12:13 ` Stefan Hajnoczi
  0 siblings, 1 reply; 8+ messages in thread
From: Shmulik Ladkani @ 2015-06-20 11:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jason Wang, idan.brown, Shmulik Ladkani, Stefan Hajnoczi

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 <shmulik.ladkani@ravellosystems.com>
---
 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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-09-29 11:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-20 11:26 [Qemu-devel] [PATCH] net: Allow specifying maximum number of network NICs during configure Shmulik Ladkani
2015-06-22 12:13 ` Stefan Hajnoczi
2015-06-22 14:42   ` Shmulik Ladkani
2015-09-28 11:52   ` [Qemu-devel] Problems on vlan-based vnics! cauchy-love
2015-09-29  3:19     ` Jason Wang
2015-09-29  5:28       ` cauchy-love
2015-09-29  5:36       ` cauchy-love
2015-09-29 11:46       ` cauchy-love

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).