mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-06 07:20:29 +03:00
Merge branch 'fix-post-kvm' into 'master'
Fix post KVM A couple of fixes to the KVM support that was just merged, as reported by @CiaranG See merge request !171
This commit is contained in:
commit
7cbdaedf2e
1 changed files with 13 additions and 9 deletions
|
|
@ -72,7 +72,7 @@ if os.path.isfile('/usr/bin/systemd-detect-virt'):
|
|||
virt = subprocess.check_output('/usr/bin/systemd-detect-virt').strip().decode('utf-8')
|
||||
except subprocess.CalledProcessError as e:
|
||||
virt = 'none'
|
||||
if virt == 'qemu' or virt == 'kvm':
|
||||
if virt == 'qemu' or virt == 'kvm' or virt == 'bochs':
|
||||
print('Running in a VM guest, defaulting to QEMU/KVM via libvirt')
|
||||
config['vm_provider'] = 'libvirt'
|
||||
elif virt != 'none':
|
||||
|
|
@ -96,14 +96,18 @@ if os.path.exists(boxfile):
|
|||
|
||||
if options.clean:
|
||||
vagrant(['destroy', '-f'], cwd=serverdir, printout=options.verbose)
|
||||
if config['vm_provider'] == 'libvirt':
|
||||
subprocess.call(['virsh', 'undefine', 'buildserver_default'])
|
||||
subprocess.call(['virsh', 'vol-delete', '/var/lib/libvirt/images/buildserver_default.img'])
|
||||
|
||||
# Update cached files.
|
||||
cachedir = config['cachedir']
|
||||
if not os.path.exists(cachedir):
|
||||
os.makedirs(cachedir, 0o755)
|
||||
|
||||
tmp = cachedir
|
||||
while tmp != '/':
|
||||
if config['vm_provider'] == 'libvirt':
|
||||
tmp = cachedir
|
||||
while tmp != '/':
|
||||
mode = os.stat(tmp).st_mode
|
||||
if not (stat.S_IXUSR & mode and stat.S_IXGRP & mode and stat.S_IXOTH & mode):
|
||||
print('ERROR:', tmp, 'will not be accessible to the VM! To fix, run:')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue