Browse code

Only set hw_rng_model by default if we're on libvirt

This makes no sense to set on _every_ devstack deployment, only
if we are using libvirt qemu or kvm. Make it conditional.

Change-Id: I860e899274646ff73b8f084a0583325239aee9cc

Dan Smith authored on 2020/07/16 06:54:22
Showing 1 changed files
... ...
@@ -324,7 +324,16 @@ function upload_image {
324 324
     local disk_format=""
325 325
     local container_format=""
326 326
     local unpack=""
327
-    local img_property="hw_rng_model=virtio"
327
+    local img_property=""
328
+
329
+    # NOTE(danms): If we're on libvirt/qemu or libvirt/kvm, set the hw_rng_model
330
+    # to libvirt in the image properties.
331
+    if [[ "$VIRT_DRIVER" == "libvirt" ]]; then
332
+        if [[ "$LIBVIRT_TYPE" == "qemu" || "$LIBVIRT_TYPE" == "kvm" ]]; then
333
+            img_property="hw_rng_model=virtio"
334
+        fi
335
+    fi
336
+
328 337
     case "$image_fname" in
329 338
         *.tar.gz|*.tgz)
330 339
             # Extract ami and aki files