Merge branch 'master' into hvm

This commit is contained in:
Marek Marczykowski 2012-08-06 15:00:02 +02:00
commit a67bf1f1c0
5 changed files with 28 additions and 8 deletions

16
dom0/aux-tools/cleanup_dispvms Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/python
from qubes.qubes import QubesVmCollection
def main():
qvm_collection = QubesVmCollection()
qvm_collection.lock_db_for_writing()
qvm_collection.load()
for vm in qvm_collection.values():
if vm.is_disposablevm() and not vm.is_running():
qvm_collection.pop(vm.qid)
qvm_collection.save()
qvm_collection.unlock_db()
main()

View File

@ -30,6 +30,8 @@ start()
xl sched-credit -d 0 -w 512 xl sched-credit -d 0 -w 512
cp /var/lib/qubes/qubes.xml /var/lib/qubes/backup/qubes-$(date +%F-%T).xml cp /var/lib/qubes/qubes.xml /var/lib/qubes/backup/qubes-$(date +%F-%T).xml
/usr/lib/qubes/cleanup_dispvms
/usr/lib/qubes/qmemman_daemon.py /usr/lib/qubes/qmemman_daemon.py
MEM_CHANGE_THRESHOLD_KB=30000 MEM_CHANGE_THRESHOLD_KB=30000
MEMINFO_DELAY_USEC=100000 MEMINFO_DELAY_USEC=100000

View File

@ -1025,7 +1025,7 @@ class QubesVm(object):
print >> sys.stderr, "--> Creating icon symlink: {0} -> {1}".format(self.icon_path, self.label.icon_path) print >> sys.stderr, "--> Creating icon symlink: {0} -> {1}".format(self.icon_path, self.label.icon_path)
os.symlink (self.label.icon_path, self.icon_path) os.symlink (self.label.icon_path, self.icon_path)
def create_appmenus(self, verbose, source_template = None): def create_appmenus(self, verbose=False, source_template = None):
if source_template is None: if source_template is None:
source_template = self.template source_template = self.template
@ -1114,7 +1114,7 @@ class QubesVm(object):
shutil.copy(src_vm.icon_path, self.icon_path) shutil.copy(src_vm.icon_path, self.icon_path)
# Create appmenus # Create appmenus
self.create_appmenus(verbose) self.create_appmenus(verbose=verbose)
def remove_appmenus(self): def remove_appmenus(self):
vmtype = None vmtype = None
@ -1664,7 +1664,7 @@ class QubesTemplateVm(QubesVm):
# Create root-cow.img # Create root-cow.img
self.commit_changes(verbose=verbose) self.commit_changes(verbose=verbose)
def create_appmenus(self, verbose, source_template = None): def create_appmenus(self, verbose=False, source_template = None):
if source_template is None: if source_template is None:
source_template = self.template source_template = self.template
@ -1680,7 +1680,7 @@ class QubesTemplateVm(QubesVm):
self.remove_appmenus() self.remove_appmenus()
def post_rename(self, old_name): def post_rename(self, old_name):
self.create_appmenus(False) self.create_appmenus(verbose=False)
old_dirpath = os.path.dirname(self.dir_path) + '/' + old_name old_dirpath = os.path.dirname(self.dir_path) + '/' + old_name
self.clean_volatile_img = self.clean_volatile_img.replace(old_dirpath, self.dir_path) self.clean_volatile_img = self.clean_volatile_img.replace(old_dirpath, self.dir_path)
@ -1918,7 +1918,7 @@ class QubesNetVm(QubesVm):
self.dir_path + '/' + qubes_whitelisted_appmenus) self.dir_path + '/' + qubes_whitelisted_appmenus)
if not self.internal: if not self.internal:
self.create_appmenus (verbose, source_template=source_template) self.create_appmenus (verbose=verbose, source_template=source_template)
def remove_from_disk(self): def remove_from_disk(self):
if dry_run: if dry_run:
@ -2226,7 +2226,7 @@ class QubesAppVm(QubesVm):
super(QubesAppVm, self).create_on_disk(verbose, source_template=source_template) super(QubesAppVm, self).create_on_disk(verbose, source_template=source_template)
if not self.internal: if not self.internal:
self.create_appmenus (verbose, source_template=source_template) self.create_appmenus (verbose=verbose, source_template=source_template)
def remove_from_disk(self): def remove_from_disk(self):
if dry_run: if dry_run:
@ -2239,7 +2239,7 @@ class QubesAppVm(QubesVm):
self.remove_appmenus() self.remove_appmenus()
def post_rename(self, old_name): def post_rename(self, old_name):
self.create_appmenus(False) self.create_appmenus(verbose=False)
class QubesHVm(QubesVm): class QubesHVm(QubesVm):
""" """

View File

@ -1,4 +1,4 @@
.*/repodata/[A-Za-z0-9-]*\(primary\|filelist\|comps\(-[a-z0-9]*\)\?\|other\|prestodelta\|updateinfo\)\.\(sqlite\|xml\)\(\.bz2\|\.gz\)\?$ .*/repodata/[A-Za-z0-9-]*\(primary\|filelists\|comps\(-[a-z0-9]*\)\?\|other\|prestodelta\|updateinfo\)\.\(sqlite\|xml\)\(\.bz2\|\.gz\)\?$
.*/repodata/repomd\.xml$ .*/repodata/repomd\.xml$
.*\.rpm$ .*\.rpm$
.*\.drpm$ .*\.drpm$

View File

@ -103,6 +103,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/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/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/remove_appvm_appmenus.sh $RPM_BUILD_ROOT/usr/lib/qubes
cp aux-tools/cleanup_dispvms $RPM_BUILD_ROOT/usr/lib/qubes
cp qmemman/server.py $RPM_BUILD_ROOT/usr/lib/qubes/qmemman_daemon.py cp qmemman/server.py $RPM_BUILD_ROOT/usr/lib/qubes/qmemman_daemon.py
cp ../misc/meminfo-writer $RPM_BUILD_ROOT/usr/lib/qubes/ cp ../misc/meminfo-writer $RPM_BUILD_ROOT/usr/lib/qubes/
cp ../qrexec/qrexec_daemon $RPM_BUILD_ROOT/usr/lib/qubes/ cp ../qrexec/qrexec_daemon $RPM_BUILD_ROOT/usr/lib/qubes/
@ -348,6 +349,7 @@ fi
/usr/lib/qubes/patch_appvm_initramfs.sh /usr/lib/qubes/patch_appvm_initramfs.sh
/usr/lib/qubes/unbind_pci_device.sh /usr/lib/qubes/unbind_pci_device.sh
/usr/lib/qubes/unbind_all_network_devices /usr/lib/qubes/unbind_all_network_devices
/usr/lib/qubes/cleanup_dispvms
/usr/lib/qubes/convert_apptemplate2vm.sh /usr/lib/qubes/convert_apptemplate2vm.sh
/usr/lib/qubes/convert_dirtemplate2vm.sh /usr/lib/qubes/convert_dirtemplate2vm.sh
/usr/lib/qubes/create_apps_for_appvm.sh /usr/lib/qubes/create_apps_for_appvm.sh