Hello Chris,
On Mon, 2012-06-18 at 14:01 +0530, Onkar N Mahajan wrote:
> 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
two add_drive function calls have been added
For storage pools , where filename is None and image_pool, image_vol,
image_device parameters are configured -
> - 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
Storage pools are not being used case - here we are passing None for
'image_pools', 'image_vol' and 'image_device' as they are irrelevant
in this case - these are two different cases - I have unit tested the
patch for most buses (ide,scsi, virtio )before sending , and it works
for them cleanly. I have re-send the patch (see below)
> + 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
>
*** Re-sending patch ***
Only change seems to be virt_utils replaced by virt_storage , which
seems to have changed after I sent the patch. So re-sending this patch
with only this change :
---
client/virt/libvirt_vm.py | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/client/virt/libvirt_vm.py b/client/virt/libvirt_vm.py
index c784f83..f0ff7d6 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"),
@@ -985,6 +983,20 @@ class VM(virt_vm.BaseVM):
image_params.get("drive_sparse"),
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_storage.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')):
--
1.7.4.4
Best regards,
--
Onkar N Mahajan
System Software Engineer,
IBM Linux Technology Center,
Bangalore,India
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest