backups: improve error reporting when something failed in dest VM
This commit is contained in:
		
							parent
							
								
									bcf1a19807
								
							
						
					
					
						commit
						eeca3eb697
					
				| @ -349,7 +349,7 @@ def backup_do(base_backup_dir, files_to_backup, passphrase, | |||||||
|         backup_target = "QUBESRPC qubes.Backup none" |         backup_target = "QUBESRPC qubes.Backup none" | ||||||
| 
 | 
 | ||||||
|         # If APPVM, STDOUT is a PIPE |         # If APPVM, STDOUT is a PIPE | ||||||
|         vmproc = appvm.run(command = backup_target, passio_popen = True) |         vmproc = appvm.run(command = backup_target, passio_popen = True, passio_stderr = True) | ||||||
|         vmproc.stdin.write(base_backup_dir.\ |         vmproc.stdin.write(base_backup_dir.\ | ||||||
|                 replace("\r","").replace("\n","")+"\n") |                 replace("\r","").replace("\n","")+"\n") | ||||||
|         backup_stdout = vmproc.stdin |         backup_stdout = vmproc.stdin | ||||||
| @ -492,8 +492,12 @@ def backup_do(base_backup_dir, files_to_backup, passphrase, | |||||||
| 
 | 
 | ||||||
|             if len(run_error) > 0: |             if len(run_error) > 0: | ||||||
|                 send_proc.terminate() |                 send_proc.terminate() | ||||||
|                 raise QubesException("Failed to perform backup: error with "+ \ |                 if run_error == "VM" and vmproc: | ||||||
|                         run_error) |                     raise QubesException("Failed to write the backup, the VM output:\n" + | ||||||
|  |                             vmproc.stderr.read()) | ||||||
|  |                 else: | ||||||
|  |                     raise QubesException("Failed to perform backup: error in "+ \ | ||||||
|  |                             run_error) | ||||||
| 
 | 
 | ||||||
|             # Send the chunk to the backup target |             # Send the chunk to the backup target | ||||||
|             to_send.put(os.path.relpath(chunkfile, backup_tmpdir)) |             to_send.put(os.path.relpath(chunkfile, backup_tmpdir)) | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Marek Marczykowski-Górecki
						Marek Marczykowski-Górecki