From 1071e3a53c8ddec88c90e37de568851b99a5a93e Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Tue, 19 Apr 2011 13:07:13 +0200 Subject: [PATCH 1/5] Fix typo --- appvm/qvm-copy-to-vm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appvm/qvm-copy-to-vm b/appvm/qvm-copy-to-vm index 4817b43b..ff4d620e 100755 --- a/appvm/qvm-copy-to-vm +++ b/appvm/qvm-copy-to-vm @@ -49,7 +49,7 @@ while true ; do read agentpid sentsize agentstatus < $PROGRESS_FILE if [ "x"$agentstatus = x ] ; then continue ; fi if ! [ -e /proc/$agentpid ] ; then break ; fi - if [ "x"$agentstatus = xdone ] ; then break ; fi + if [ "x"$agentstatus = xDONE ] ; then break ; fi CURRSIZE=$(($sentsize/1024)) if [ $DO_PROGRESS = 1 ] ; then echo -ne "\r sent $CURRSIZE/$SIZE KB " From f28407bca6ef2cd2ce099e9f3cf34dcca6c42867 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Tue, 19 Apr 2011 13:10:18 +0200 Subject: [PATCH 2/5] Run qubes_core_appvm also in TemplateVM (#222) --- appvm/qubes_core_appvm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appvm/qubes_core_appvm b/appvm/qubes_core_appvm index 32c0833f..a4c24651 100755 --- a/appvm/qubes_core_appvm +++ b/appvm/qubes_core_appvm @@ -26,7 +26,7 @@ start() fi type=$(/usr/bin/xenstore-read qubes_vm_type) - if [ "$type" != "AppVM" -a "$type" != "DisposableVM" ]; then + if [ "$type" != "AppVM" -a "$type" != "DisposableVM" -a "$type" != "TemplateVM" ]; then # This script runs only on AppVMs return 0 fi From 3f28f1633642a4cd608835d6e6629fdd0da4a120 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Tue, 19 Apr 2011 15:56:00 +0200 Subject: [PATCH 3/5] Link to icon on template clone (#225) --- dom0/qvm-core/qubes.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dom0/qvm-core/qubes.py b/dom0/qvm-core/qubes.py index 514deda6..707683c8 100755 --- a/dom0/qvm-core/qubes.py +++ b/dom0/qvm-core/qubes.py @@ -1130,6 +1130,11 @@ class QubesTemplateVm(QubesVm): format(src_template_vm.appmenus_templates_dir, self.appmenus_templates_dir) shutil.copytree (src_template_vm.appmenus_templates_dir, self.appmenus_templates_dir) + icon_path = "/usr/share/qubes/icons/template.png" + if verbose: + print "--> Creating icon symlink: {0} -> {1}".format(self.icon_path, icon_path) + os.symlink (icon_path, self.icon_path) + # Create root-cow.img self.commit_changes() From 832289c53eb39b3bc06e32c4de86caba79a63e7e Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Wed, 20 Apr 2011 20:05:58 +0200 Subject: [PATCH 4/5] Catch more exceptions during VM restore (#212) --- dom0/qvm-tools/qvm-backup-restore | 41 ++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/dom0/qvm-tools/qvm-backup-restore b/dom0/qvm-tools/qvm-backup-restore index 991ebb4f..121956a8 100755 --- a/dom0/qvm-tools/qvm-backup-restore +++ b/dom0/qvm-tools/qvm-backup-restore @@ -318,18 +318,19 @@ def main(): for vm in [ vm for vm in vms_to_restore if vm.is_template()]: print "-> Adding Template VM {0}...".format(vm.name) updateable = vm.updateable - vm = host_collection.add_new_templatevm(vm.name, + try: + vm = host_collection.add_new_templatevm(vm.name, conf_file=vm.conf_file, dir_path=vm.dir_path, installed_by_rpm=False) - vm.updateable = updateable - try: + vm.updateable = updateable vm.verify_files() - except QubesException as err: + except Exception as err: print "ERROR: {0}".format(err) print "*** Skiping VM: {0}".vm.name - host_collection.pop(vm.qid) + if vm: + host_collection.pop(vm.qid) continue try: @@ -361,34 +362,50 @@ def main(): updateable = vm.updateable - vm = host_collection.add_new_appvm(vm.name, template_vm, + try: + vm = host_collection.add_new_appvm(vm.name, template_vm, conf_file=vm.conf_file, dir_path=vm.dir_path, updateable=updateable, label=vm.label) + except Exception as err: + print "ERROR: {0}".format(err) + print "*** Skiping VM: {0}".format(vm.name) + if vm: + host_collection.pop(vm.qid) + continue if not uses_default_netvm: vm.uses_default_netvm = False vm.netvm_vm = netvm_vm - if template_vm is not None and recreate_conf: - print "--> Recreating config file..." - vm.create_config_file() + try: + if template_vm is not None and recreate_conf: + print "--> Recreating config file..." + vm.create_config_file() + except QubesException as err: + print "ERROR xen config restore: {0}".format(err) + print "*** VM '{0}' will not boot until you manually fix it (or correctly restore this VM)!".format(vm.name) + + try: + vm.create_appmenus(verbose=True) + except QubesException as err: + print "ERROR during appmenu restore: {0}".format(err) + print "*** VM '{0}' will not have appmenus".format(vm.name) - vm.create_appmenus(verbose=True) try: vm.verify_files() except QubesException as err: print "ERROR: {0}".format(err) print "*** Skiping VM: {0}".format(vm.name) host_collection.pop(vm.qid) + continue try: vm.add_to_xen_storage() except (IOError, OSError) as err: print "ERROR: {0}".format(err) - print "*** Skiping VM: {0}".format(vm.name) - host_collection.pop(vm.qid) + print "*** VM '{0}' will not boot until you manually fix it (or correctly restore this VM)!".format(vm.name) backup_collection.unlock_db() From 761c774189c0f1bee0bb1ae7fbd8020605315736 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Wed, 27 Apr 2011 23:07:38 +0200 Subject: [PATCH 5/5] Remove correct lockfile on qubes_setupdvm stop --- dom0/init.d/qubes_setupdvm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom0/init.d/qubes_setupdvm b/dom0/init.d/qubes_setupdvm index 26390536..ba4e5d02 100755 --- a/dom0/init.d/qubes_setupdvm +++ b/dom0/init.d/qubes_setupdvm @@ -44,7 +44,7 @@ start() stop() { - rm -f /var/lock/subsys/qubes_netvm + rm -f /var/lock/subsys/qubes_setupdvm success echo }