diff --git a/NEWS b/NEWS index 38e673e0..639a5760 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ - highlight scheduled jobs with dispatch problems (due to constraints) - allow to specify a log message in lock command - Add '--wipe' option to osc chroot for deleting buildroots + - Add '--vm-memory' option to osc build 0.155 - osc service runall: runs all service local, independend of the mode diff --git a/osc/build.py b/osc/build.py index 45bb8116..5887317b 100644 --- a/osc/build.py +++ b/osc/build.py @@ -491,6 +491,7 @@ def main(apiurl, opts, argv): build_root = None cache_dir = None build_uid = '' + vm_memory = config['build-memory'] vm_type = config['build-type'] vm_telnet = None @@ -571,6 +572,8 @@ def main(apiurl, opts, argv): else: print('Error: build-uid arg must be 2 colon separated numerics: "uid:gid" or "caller"', file=sys.stderr) return 1 + if opts.vm_memory: + vm_memory = opts.vm_memory if opts.vm_type: vm_type = opts.vm_type if opts.vm_telnet: @@ -1110,8 +1113,8 @@ def main(apiurl, opts, argv): vm_options = [ '--vm-type=%s' % vm_type ] if vm_telnet: vm_options += [ '--vm-telnet=' + vm_telnet ] - if config['build-memory']: - vm_options += [ '--memory=' + config['build-memory'] ] + if vm_memory: + vm_options += [ '--memory=' + vm_memory ] if vm_type != 'lxc': vm_options += [ '--vm-disk=' + my_build_device ] vm_options += [ '--vm-swap=' + my_build_swap ] @@ -1127,8 +1130,6 @@ def main(apiurl, opts, argv): build_root += '/.mount' - if config['build-memory']: - vm_options += [ '--memory=' + config['build-memory'] ] if config['build-vmdisk-rootsize']: vm_options += [ '--vmdisk-rootsize=' + config['build-vmdisk-rootsize'] ] if config['build-vmdisk-swapsize']: diff --git a/osc/commandline.py b/osc/commandline.py index 7c76bf6f..97573bb1 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -5826,6 +5826,8 @@ Please submit there instead, or use --nodevelproject to force direct submission. help='build a package which does not exist on the server') @cmdln.option('--linksources', action='store_true', help='use hard links instead of a deep copied source') + @cmdln.option('--vm-memory', metavar='TYPE', + help='use given MB for VM') @cmdln.option('--vm-type', metavar='TYPE', help='use VM type TYPE (e.g. kvm)') @cmdln.option('--vm-telnet', metavar='TELNET',