Browse code

Merge "Only set hw_rng_model by default if we're on libvirt"

Zuul authored on 2020/07/17 23:53:32
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