Make core limitation work for both client and server so that we can run tests on the same
machine if desired. The core_list flags to qps_driver are comma-separated lists of
core numbers.
diff --git a/test/cpp/qps/server.h b/test/cpp/qps/server.h
index 620bc32..474473a 100644
--- a/test/cpp/qps/server.h
+++ b/test/cpp/qps/server.h
@@ -34,11 +34,13 @@
 #ifndef TEST_QPS_SERVER_H
 #define TEST_QPS_SERVER_H
 
+#include <vector>
 #include <grpc/support/cpu.h>
 #include <grpc++/security/server_credentials.h>
 
 #include "test/core/end2end/data/ssl_test_data.h"
 #include "test/core/util/port.h"
+#include "test/cpp/qps/coresched.h"
 #include "test/cpp/qps/timer.h"
 #include "src/proto/grpc/testing/messages.grpc.pb.h"
 #include "src/proto/grpc/testing/control.grpc.pb.h"
@@ -49,6 +51,16 @@
 class Server {
  public:
   explicit Server(const ServerConfig& config) : timer_(new Timer) {
+    int clsize = config.core_list_size();
+    if (clsize > 0) {
+      std::vector<int> core_list;
+      for (int i = 0; i < clsize; i++) {
+        core_list.push_back(config.core_list(i));
+      }
+      cores_ = LimitCores(core_list);
+    } else {
+      cores_ = gpr_cpu_num_cores();
+    }
     if (config.port()) {
       port_ = config.port();
     } else {
@@ -87,7 +99,7 @@
   }
 
   int port() const { return port_; }
-  int cores() const { return gpr_cpu_num_cores(); }
+  int cores() const { return cores_;}
   static std::shared_ptr<ServerCredentials> CreateServerCredentials(
       const ServerConfig& config) {
     if (config.has_security_params()) {
@@ -104,6 +116,7 @@
 
  private:
   int port_;
+  int cores_;
   std::unique_ptr<Timer> timer_;
 };