Merge branch 'r1-beta1-fixes' of git.qubes-os.org:/var/lib/qubes/git/marmarek/core into r1-beta1

This commit is contained in:
Joanna Rutkowska 2011-05-10 11:42:07 +02:00
commit cb6a4176cb
5 changed files with 37 additions and 15 deletions

View File

@ -26,7 +26,7 @@ start()
fi fi
type=$(/usr/bin/xenstore-read qubes_vm_type) 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 # This script runs only on AppVMs
return 0 return 0
fi fi

View File

@ -49,7 +49,7 @@ while true ; do
read agentpid sentsize agentstatus < $PROGRESS_FILE read agentpid sentsize agentstatus < $PROGRESS_FILE
if [ "x"$agentstatus = x ] ; then continue ; fi if [ "x"$agentstatus = x ] ; then continue ; fi
if ! [ -e /proc/$agentpid ] ; then break ; 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)) CURRSIZE=$(($sentsize/1024))
if [ $DO_PROGRESS = 1 ] ; then if [ $DO_PROGRESS = 1 ] ; then
echo -ne "\r sent $CURRSIZE/$SIZE KB " echo -ne "\r sent $CURRSIZE/$SIZE KB "

View File

@ -44,7 +44,7 @@ start()
stop() stop()
{ {
rm -f /var/lock/subsys/qubes_netvm rm -f /var/lock/subsys/qubes_setupdvm
success success
echo echo
} }

View File

@ -1130,6 +1130,11 @@ class QubesTemplateVm(QubesVm):
format(src_template_vm.appmenus_templates_dir, self.appmenus_templates_dir) format(src_template_vm.appmenus_templates_dir, self.appmenus_templates_dir)
shutil.copytree (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 # Create root-cow.img
self.commit_changes() self.commit_changes()

View File

@ -318,17 +318,18 @@ def main():
for vm in [ vm for vm in vms_to_restore if vm.is_template()]: for vm in [ vm for vm in vms_to_restore if vm.is_template()]:
print "-> Adding Template VM {0}...".format(vm.name) print "-> Adding Template VM {0}...".format(vm.name)
updateable = vm.updateable updateable = vm.updateable
try:
vm = host_collection.add_new_templatevm(vm.name, vm = host_collection.add_new_templatevm(vm.name,
conf_file=vm.conf_file, conf_file=vm.conf_file,
dir_path=vm.dir_path, dir_path=vm.dir_path,
installed_by_rpm=False) installed_by_rpm=False)
vm.updateable = updateable vm.updateable = updateable
try:
vm.verify_files() vm.verify_files()
except QubesException as err: except Exception as err:
print "ERROR: {0}".format(err) print "ERROR: {0}".format(err)
print "*** Skiping VM: {0}".vm.name print "*** Skiping VM: {0}".vm.name
if vm:
host_collection.pop(vm.qid) host_collection.pop(vm.qid)
continue continue
@ -361,34 +362,50 @@ def main():
updateable = vm.updateable updateable = vm.updateable
try:
vm = host_collection.add_new_appvm(vm.name, template_vm, vm = host_collection.add_new_appvm(vm.name, template_vm,
conf_file=vm.conf_file, conf_file=vm.conf_file,
dir_path=vm.dir_path, dir_path=vm.dir_path,
updateable=updateable, updateable=updateable,
label=vm.label) 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: if not uses_default_netvm:
vm.uses_default_netvm = False vm.uses_default_netvm = False
vm.netvm_vm = netvm_vm vm.netvm_vm = netvm_vm
try:
if template_vm is not None and recreate_conf: if template_vm is not None and recreate_conf:
print "--> Recreating config file..." print "--> Recreating config file..."
vm.create_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) 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)
try: try:
vm.verify_files() vm.verify_files()
except QubesException as err: except QubesException as err:
print "ERROR: {0}".format(err) print "ERROR: {0}".format(err)
print "*** Skiping VM: {0}".format(vm.name) print "*** Skiping VM: {0}".format(vm.name)
host_collection.pop(vm.qid) host_collection.pop(vm.qid)
continue
try: try:
vm.add_to_xen_storage() vm.add_to_xen_storage()
except (IOError, OSError) as err: except (IOError, OSError) as err:
print "ERROR: {0}".format(err) print "ERROR: {0}".format(err)
print "*** Skiping VM: {0}".format(vm.name) print "*** VM '{0}' will not boot until you manually fix it (or correctly restore this VM)!".format(vm.name)
host_collection.pop(vm.qid)
backup_collection.unlock_db() backup_collection.unlock_db()