This patch fixes this issue - 
https://github.com/autotest/autotest/issues/390

 client/virt/libvirt_vm.py |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/client/virt/libvirt_vm.py b/client/virt/libvirt_vm.py
index c784f83..5bb315c 100644
--- a/client/virt/libvirt_vm.py
+++ b/client/virt/libvirt_vm.py
@@ -972,10 +972,8 @@ class VM(virt_vm.BaseVM):
             filename = virt_storage.get_image_filename(image_params, root_dir)
             if image_params.get("use_storage_pool") == "yes":
                 filename = None
-            if image_params.get("boot_drive") == "no":
-                continue
-            virt_install_cmd += add_drive(help,
-                             filename,
+                virt_install_cmd += add_drive(help,
+                                  filename,
                                   image_params.get("image_pool"),
                                   image_params.get("image_vol"),
                                   image_params.get("image_device"),
@@ -986,6 +984,21 @@ class VM(virt_vm.BaseVM):
                                   image_params.get("drive_cache"),
                                   image_params.get("image_format"))
 
+            if image_params.get("boot_drive") == "no":
+                continue
+            if filename:
+               virt_install_cmd += add_drive(help,
+                                   virt_utils.get_image_filename(image_params, 
root_dir),
+                                   None,
+                                   None,
+                                   None,
+                                   image_params.get("drive_format"),
+                                   None,
+                                   image_params.get("image_size"),
+                                   image_params.get("drive_sparse"),
+                                   image_params.get("drive_cache"),
+                                   image_params.get("image_format"))
+
         if (params.get('unattended_delivery_method') != 'integrated' and
             not (self.driver_type == 'xen' and params.get('hvm_or_pv') == 
'pv')):
             for cdrom in params.objects("cdroms"):
-- 
1.7.4.4

-- 
Onkar N Mahajan
System Software Engineer,
IBM Linux Technology Center,
Bangalore,India

_______________________________________________
Autotest mailing list
Autotest@test.kernel.org
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to