[virt-tools-list] [virt-bootstrap][PATCH 1/7] docker: only one layer drive per guestfs appliance
Radostin Stoyanov
rstoyanov1 at gmail.com
Tue Sep 5 17:14:13 UTC 2017
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()
Pylint complains for src/virtBootstrap/utils.py:129:5: E303 too many
blank lines (2)
> +
>
ACKed without this last blank line.
> def extract_layer(self, index, dev):
> """
More information about the virt-tools-list
mailing list