diff --git a/dom0/aux-tools/reset_vm_configs.py b/dom0/aux-tools/reset_vm_configs.py new file mode 100755 index 00000000..6930a1fa --- /dev/null +++ b/dom0/aux-tools/reset_vm_configs.py @@ -0,0 +1,24 @@ +#!/usr/bin/python2.6 +from qubes.qubes import QubesVmCollection +import sys +def main(): + if len(sys.argv) != 2: + print 'Usage: fixconf templatename' + sys.exit(1) + qvm_collection = QubesVmCollection() + qvm_collection.lock_db_for_reading() + qvm_collection.load() + qvm_collection.unlock_db() + templ = sys.argv[1] + tvm = qvm_collection.get_vm_by_name(templ) + if tvm is None: + print 'Template', templ, 'does not exist' + sys.exit(1) + if not tvm.is_templete(): + print templ, 'is not a template' + sys.exit(1) + for vm in qvm_collection.values(): + if vm.is_appvm() and vm.template_vm.qid == tvm.qid: + vm.create_config_file() + +main() diff --git a/rpm_spec/core-dom0.spec b/rpm_spec/core-dom0.spec index 0ab227bc..8d62ea57 100644 --- a/rpm_spec/core-dom0.spec +++ b/rpm_spec/core-dom0.spec @@ -81,6 +81,7 @@ cp aux-tools/convert_apptemplate2vm.sh $RPM_BUILD_ROOT/usr/lib/qubes cp aux-tools/convert_dirtemplate2vm.sh $RPM_BUILD_ROOT/usr/lib/qubes cp aux-tools/create_apps_for_appvm.sh $RPM_BUILD_ROOT/usr/lib/qubes cp aux-tools/remove_appvm_appmenus.sh $RPM_BUILD_ROOT/usr/lib/qubes +cp aux-tools/reset_vm_configs.py $RPM_BUILD_ROOT/usr/lib/qubes cp pendrive_swapper/qubes_pencmd $RPM_BUILD_ROOT/usr/lib/qubes cp qmemman/server.py $RPM_BUILD_ROOT/usr/lib/qubes/qmemman_daemon.py cp ../common/meminfo-writer $RPM_BUILD_ROOT/usr/lib/qubes/ @@ -216,6 +217,7 @@ fi /usr/lib/qubes/convert_dirtemplate2vm.sh /usr/lib/qubes/create_apps_for_appvm.sh /usr/lib/qubes/remove_appvm_appmenus.sh +/usr/lib/qubes/reset_vm_configs.py /usr/lib/qubes/qubes_pencmd /usr/lib/qubes/qmemman_daemon.py* /usr/lib/qubes/meminfo-writer