summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Bosdonnat <cbosdonnat@suse.com>2017-09-05 15:34:47 +0200
committerCédric Bosdonnat <cbosdonnat@suse.com>2017-09-06 11:20:50 +0200
commita42c936f607b695780e8a4a289ac6ad945f54391 (patch)
tree18b826070b2d31e6dccec5bfa517e703a844b185
parent9e6a003a8d2f72f3db09404b726c4abad5316e29 (diff)
downloadvirt-bootstrap.git-a42c936f607b695780e8a4a289ac6ad945f54391.tar.gz
virt-bootstrap.git-a42c936f607b695780e8a4a289ac6ad945f54391.tar.xz
virt-bootstrap.git-a42c936f607b695780e8a4a289ac6ad945f54391.zip
docker: only one layer drive per guestfs appliance
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.
-rw-r--r--src/virtBootstrap/utils.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/virtBootstrap/utils.py b/src/virtBootstrap/utils.py
index a72c52c..6dbea87 100644
--- a/src/virtBootstrap/utils.py
+++ b/src/virtBootstrap/utils.py
@@ -119,12 +119,11 @@ 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):
"""