← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad-buildd/lxd-loop-devices into lp:launchpad-buildd

 

Colin Watson has proposed merging lp:~cjwatson/launchpad-buildd/lxd-loop-devices into lp:launchpad-buildd with lp:~cjwatson/launchpad-buildd/lxd-powerpc as a prerequisite.

Commit message:
Make loop devices available to LXD containers.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad-buildd/lxd-loop-devices/+merge/330270

This fixes CPC livefs builds.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad-buildd/lxd-loop-devices into lp:launchpad-buildd.
=== modified file 'debian/changelog'
--- debian/changelog	2017-09-06 09:32:39 +0000
+++ debian/changelog	2017-09-06 09:32:39 +0000
@@ -2,6 +2,7 @@
 
   * Tell LXD to disable seccomp on powerpc, since it doesn't work there on
     Linux 4.4.
+  * Make loop devices available to LXD containers.
 
  -- Colin Watson <cjwatson@xxxxxxxxxx>  Tue, 05 Sep 2017 10:41:55 +0100
 

=== modified file 'lpbuildd/target/lxd.py'
--- lpbuildd/target/lxd.py	2017-09-06 09:32:39 +0000
+++ lpbuildd/target/lxd.py	2017-09-06 09:32:39 +0000
@@ -289,7 +289,20 @@
                 "parent": self.bridge_name,
                 "type": "nic",
                 },
+            "loop-control": {
+                "major": "10",
+                "minor": "237",
+                "path": "/dev/loop-control",
+                "type": "unix-char",
+                },
             }
+        for minor in range(8):
+            devices["loop%d" % minor] = {
+                "major": "7",
+                "minor": str(minor),
+                "path": "/dev/loop%d" % minor,
+                "type": "unix-block",
+                }
         self.client.profiles.create(self.profile_name, config, devices)
 
     def start(self):

=== modified file 'lpbuildd/target/tests/test_lxd.py'
--- lpbuildd/target/tests/test_lxd.py	2017-09-06 09:32:39 +0000
+++ lpbuildd/target/tests/test_lxd.py	2017-09-06 09:32:39 +0000
@@ -145,7 +145,20 @@
                 "parent": "lpbuilddbr0",
                 "type": "nic",
                 },
+            "loop-control": {
+                "major": "10",
+                "minor": "237",
+                "path": "/dev/loop-control",
+                "type": "unix-char",
+                },
             }
+        for minor in range(8):
+            expected_devices["loop%d" % minor] = {
+                "major": "7",
+                "minor": str(minor),
+                "path": "/dev/loop%d" % minor,
+                "type": "unix-block",
+                }
         client.profiles.create.assert_called_once_with(
             "lpbuildd", expected_config, expected_devices)