diff --git a/linux/system-config/tmpfiles-qubes.conf b/linux/system-config/tmpfiles-qubes.conf index 834541f8..c3ca33b0 100644 --- a/linux/system-config/tmpfiles-qubes.conf +++ b/linux/system-config/tmpfiles-qubes.conf @@ -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 diff --git a/qubes/backup.py b/qubes/backup.py index a3b4f7aa..e3e6f1ec 100644 --- a/qubes/backup.py +++ b/qubes/backup.py @@ -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