[virt-tools-list] [PATCH] virt-clone: further fix guest booting when cloning a qcow2 image

Cole Robinson crobinso at redhat.com
Tue Mar 27 22:53:51 UTC 2012


On 03/24/2012 01:13 PM, Wanlong Gao wrote:
> commit f0195e95d5 didn't fix the problem completely,
> we should get the orig_disk's driver_type when setup
> cloning.
> 
> Signed-off-by: Wanlong Gao <gaowanlong at cn.fujitsu.com>
> ---
>  virtinst/CloneManager.py |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/virtinst/CloneManager.py b/virtinst/CloneManager.py
> index ff3c074..dee3c59 100644
> --- a/virtinst/CloneManager.py
> +++ b/virtinst/CloneManager.py
> @@ -499,7 +499,7 @@ class CloneDesign(object):
>              xmldisk.path = None
>              xmldisk.type = clone_disk.type
>              xmldisk.path = clone_disk.path
> -            xmldisk.driver_type = clone_disk.driver_type
> +            xmldisk.driver_type = orig_disk.driver_type
>  
>          # Save altered clone xml
>          self._clone_xml = self._guest.get_xml_config()
> @@ -553,7 +553,8 @@ class CloneDesign(object):
>                      device = VirtualDisk.DEVICE_CDROM
>  
>                  d = VirtualDisk(disk.path, conn=self._hyper_conn,
> -                                device=device, validate=validate)
> +                                device=device, driverType=disk.driver_type,
> +                                validate=validate)
>                  d.target = disk.target
>              except Exception, e:
>                  logging.debug("", exc_info=True)

Hmm, can you give an example invocation where the current code fails? I'm
having trouble understanding the problem.

Then hopefully we can turn that into a unit test that demonstrates the fix.

Thanks,
Cole




More information about the virt-tools-list mailing list