aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>2019-03-27 23:28:19 -0300
committerAndy Lutomirski <luto@kernel.org>2019-03-27 19:40:02 -0700
commit40cec5386aedce4477d1561aa87ae580af741887 (patch)
tree93128cc86f1294e51c2578bc422133dc46af53e4
parent291d880996ac94186bb5edbf9c30de9e7f7018e1 (diff)
downloadvirtme-40cec5386aedce4477d1561aa87ae580af741887.tar.gz
run.py: Add --memory argument
This new flag sets the "-m" flag of QEMU, letting the user to user the amount of memory the guest will have. Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com> Message-Id: <20190328022819.1143715-1-marcos.souza.org@gmail.com>
-rw-r--r--virtme/commands/run.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/virtme/commands/run.py b/virtme/commands/run.py
index 7836aed..c942486 100644
--- a/virtme/commands/run.py
+++ b/virtme/commands/run.py
@@ -60,6 +60,8 @@ def make_parser():
help='Allow the host to ask the guest to release memory.')
g.add_argument('--disk', action='append', default=[], metavar='NAME=PATH',
help='Add a read/write virtio-scsi disk. The device node will be /dev/disk/by-id/scsi-0virtme_disk_NAME.')
+ g.add_argument('--memory', action='store', default=None,
+ help='Set guest memory and qemu -m flag.')
g.add_argument('--name', action='store', default=None,
help='Set guest hostname and qemu -name flag.')
@@ -288,6 +290,9 @@ def main():
if args.balloon:
qemuargs.extend(['-balloon', 'virtio'])
+ if args.memory:
+ qemuargs.extend(['-m', args.memory])
+
if args.disk:
qemuargs.extend(['-device', '%s,id=scsi' % arch.virtio_dev_type('scsi')])