Procházet zdrojové kódy

Minor changes to make VMM connection really lazy

1. Fake dom0 object doesn't need proper maxmem nor vcpus - set
statically to 0 instead of getting from physical host.
2. QubesHVM doesn't preserve maxmem setting, so set it to self.memory
earlier (to suppress default total_memory/2 calculation).
Marek Marczykowski před 11 roky
rodič
revize
8e9c59e7f8
2 změnil soubory, kde provedl 7 přidání a 5 odebrání
  1. 2 0
      core-modules/006QubesAdminVm.py
  2. 5 5
      core-modules/01QubesHVm.py

+ 2 - 0
core-modules/006QubesAdminVm.py

@@ -37,6 +37,8 @@ class QubesAdminVm(QubesNetVm):
                                              dir_path=None,
                                              private_img = None,
                                              template = None,
+                                             maxmem = 0,
+                                             vcpus = 0,
                                              label = defaults["template_label"],
                                              **kwargs)
 

+ 5 - 5
core-modules/01QubesHVm.py

@@ -63,7 +63,9 @@ class QubesHVm(QubesVm):
             lambda x: system_path["config_template_hvm"]
         attrs['drive'] = { 'attr': '_drive',
                            'save': lambda: str(self.drive) }
+        # Remove this two lines when HVM will get qmemman support
         attrs['maxmem'].pop('save')
+        attrs['maxmem']['func'] = lambda x: self.memory
         attrs['timezone'] = { 'default': 'localtime',
                               'save': lambda: str(self.timezone) }
         attrs['qrexec_installed'] = { 'default': False,
@@ -93,11 +95,9 @@ class QubesHVm(QubesVm):
             (not 'xml_element' in kwargs or kwargs['xml_element'].get('guiagent_installed') is None):
             self.services['meminfo-writer'] = False
 
-        # HVM normally doesn't support dynamic memory management
-        if not ('meminfo-writer' in self.services and self.services['meminfo-writer']):
-            self.maxmem = self.memory
-
-        self._stubdom_guid_process = None
+        # Disable qemu GUID if the user installed qubes gui agent
+        if self.guiagent_installed:
+            self._start_guid_first = False
 
     @property
     def type(self):