Re: [virt-bootstrap][PATCH 1/7] docker: only one layer drive per guestfs appliance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/09/17 17:41, Cédric Bosdonnat wrote:
> The current code was trying to save time by adding all drives to the
> guestfs handle and launch the instance from it. However, this doesn't
> fly since backing chain images would be used more than once.
>
> To bad for performance, but sticking to one layer per guestfs launch
> is safer and gets the tests to the pass.
> ---
>  src/virtBootstrap/utils.py | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/src/virtBootstrap/utils.py b/src/virtBootstrap/utils.py
> index a72c52c..1fb3625 100644
> --- a/src/virtBootstrap/utils.py
> +++ b/src/virtBootstrap/utils.py
> @@ -119,12 +119,12 @@ class BuildImage(object):
>                  backingformat='qcow2'
>              )
>              self.g.add_drive(self.qcow2_files[i], format='qcow2')
> -        self.g.launch()
> -        devices = self.g.list_devices()
> -        # Tar-in layers (skip the base layer)
> -        for index in range(1, self.nlayers):
> -            self.extract_layer(index, devices[index - 1])
> -        self.g.shutdown()
> +            self.g.launch()
> +
> +            devices = self.g.list_devices()
> +            self.extract_layer(i, devices[0])
> +            self.g.shutdown()
> +
>  
>      def extract_layer(self, index, dev):
>          """
ACK

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux