backup.py: add vmN/empty file if no other files to backup
This commit is contained in:
parent
59abdeb30e
commit
6886e70aa9
@ -1,3 +1,4 @@
|
||||
d /var/run/qubes 2770 root qubes
|
||||
f /var/run/qubes/xl-lock 0660 root qubes
|
||||
f /var/run/qubes/empty 0444 root qubes
|
||||
d /var/run/xen-hotplug 0755 root root
|
||||
|
@ -381,6 +381,15 @@ class Backup(object):
|
||||
if os.path.exists(firewall_conf):
|
||||
vm_files.append(self.FileToBackup(firewall_conf, subdir))
|
||||
|
||||
if not vm_files:
|
||||
# subdir/ is needed in the tar file, otherwise restore
|
||||
# of a (Disp)VM without any backed up files is going
|
||||
# to fail. Adding a zero-sized file here happens to be
|
||||
# more straightforward than adding an empty directory.
|
||||
empty = self.FileToBackup("/var/run/qubes/empty", subdir)
|
||||
assert empty.size == 0
|
||||
vm_files.append(empty)
|
||||
|
||||
files_to_backup[vm.qid] = self.VMToBackup(vm, vm_files, subdir)
|
||||
|
||||
# Dom0 user home
|
||||
|
Loading…
Reference in New Issue
Block a user