Allow setting the number of workers to be used.

Environments with large numbers of CPUs will create a large
number of workers which can have an unnecessarily large
impact on memory usage, particular where you know how many
workers are needed.

Change-Id: Ie4bb075310a61a0873c9e56e4974600dbb4794a1
diff --git a/lib/glance b/lib/glance
index 7a28b68..47dd38d 100644
--- a/lib/glance
+++ b/lib/glance
@@ -131,6 +131,10 @@
     # sections.
     iniset $GLANCE_API_CONF glance_store filesystem_store_datadir $GLANCE_IMAGE_DIR/
 
+    if [ -n "$API_WORKERS" ]; then
+        iniset $GLANCE_API_CONF DEFAULT workers "$API_WORKERS"
+    fi
+
     # Store the images in swift if enabled.
     if is_service_enabled s-proxy; then
         iniset $GLANCE_API_CONF DEFAULT default_store swift