Parcourir la source

Add linux-kernel to defaults['pool_config']

Bahtiar `kalkin-` Gadimov il y a 8 ans
Parent
commit
ef485ca32a
3 fichiers modifiés avec 13 ajouts et 2 suppressions
  1. 1 0
      qubes/__init__.py
  2. 11 1
      qubes/config.py
  3. 1 1
      qubes/tests/storage.py

+ 1 - 0
qubes/__init__.py

@@ -1400,6 +1400,7 @@ class Qubes(PropertyHolder):
             7: Label(7, '0x75507b', 'purple'),
             8: Label(8, '0x000000', 'black'),
         }
+
         for name, config in qubes.config.defaults['pool_configs'].items():
             self.pools[name] = self._get_pool(**config)
 

+ 11 - 1
qubes/config.py

@@ -28,6 +28,8 @@
 # make a real /etc/qubes/master.conf or whatever
 #
 
+import os.path
+
 '''Constants which can be configured in one place'''
 
 qubes_base_dir = "/var/lib/qubes"
@@ -83,9 +85,17 @@ defaults = {
     'private_img_size': 2*1024*1024*1024,
     'root_img_size': 10*1024*1024*1024,
 
-    'pool_config': {'dir_path': '/var/lib/qubes/',
+    'pool_configs': {
+        'default': {'dir_path': qubes_base_dir,
                     'driver': 'xen',
                     'name': 'default'},
+        'linux-kernel': {
+            'dir_path': os.path.join(qubes_base_dir,
+                                     system_path['qubes_kernels_base_dir']),
+            'driver': 'linux-kernel',
+            'name': 'linux-kernel'
+        }
+    },
 
     # how long (in sec) to wait for VMs to shutdown,
     # before killing them (when used qvm-run with --wait option),

+ 1 - 1
qubes/tests/storage.py

@@ -74,7 +74,7 @@ class TC_00_Pool(SystemTestsMixin, QubesTestCase):
 
     def test_001_all_pool_drivers(self):
         """ The only predefined pool driver is xen """
-        self.assertEquals(["xen"], pool_drivers())
+        self.assertEquals(['linux-kernel', 'xen'], pool_drivers())
 
     def test_002_get_pool_klass(self):
         """ Expect the default pool to be `XenPool` """