backup: use offline_mode for backup collection
This object is used solely for manipulating qubes.xml for the backup. Do not open any connection to hypervisor/QubesDB/libvirt etc. This will help avoiding various leaks (memory, FD).
This commit is contained in:
		
							parent
							
								
									d3cc2d50e3
								
							
						
					
					
						commit
						abfed95bf2
					
				| @ -694,7 +694,7 @@ class Backup(object): | |||||||
|         self.tmpdir = tempfile.mkdtemp() |         self.tmpdir = tempfile.mkdtemp() | ||||||
|         shutil.copy(qubes_xml, os.path.join(self.tmpdir, 'qubes.xml')) |         shutil.copy(qubes_xml, os.path.join(self.tmpdir, 'qubes.xml')) | ||||||
|         qubes_xml = os.path.join(self.tmpdir, 'qubes.xml') |         qubes_xml = os.path.join(self.tmpdir, 'qubes.xml') | ||||||
|         backup_app = qubes.Qubes(qubes_xml) |         backup_app = qubes.Qubes(qubes_xml, offline_mode=True) | ||||||
|         backup_app.events_enabled = False |         backup_app.events_enabled = False | ||||||
| 
 | 
 | ||||||
|         files_to_backup = self._files_to_backup |         files_to_backup = self._files_to_backup | ||||||
| @ -709,6 +709,7 @@ class Backup(object): | |||||||
|             backup_app.domains[qid].features['backup-path'] = vm_info.subdir |             backup_app.domains[qid].features['backup-path'] = vm_info.subdir | ||||||
|             backup_app.domains[qid].features['backup-size'] = vm_info.size |             backup_app.domains[qid].features['backup-size'] = vm_info.size | ||||||
|         backup_app.save() |         backup_app.save() | ||||||
|  |         del backup_app | ||||||
| 
 | 
 | ||||||
|         vmproc = None |         vmproc = None | ||||||
|         if self.target_vm is not None: |         if self.target_vm is not None: | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Marek Marczykowski-Górecki
						Marek Marczykowski-Górecki