Skip to content

Commit

Permalink
Merge pull request #884 from sever-sever/T7043
Browse files Browse the repository at this point in the history
T7043: Add arguments for CPU and memory for the check-qemu-install
  • Loading branch information
sever-sever authored Jan 13, 2025
2 parents 7d86ca2 + 51895a5 commit a2fb862
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions scripts/check-qemu-install
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (C) 2019-2024, VyOS maintainers and contributors
# Copyright (C) 2019-2025, VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
Expand Down Expand Up @@ -95,6 +95,8 @@ parser.add_argument('--sbtest', help='Execute Secure Boot tests',
action='store_true', default=False)
parser.add_argument('--qemu-cmd', help='Only generate QEMU launch command',
action='store_true', default=False)
parser.add_argument('--cpu', help='Set QEMU CPU', type=int, default=2)
parser.add_argument('--memory', help='Set QEMU memory', type=int, default=4)

args = parser.parse_args()

Expand Down Expand Up @@ -168,11 +170,11 @@ def get_qemu_cmd(name, enable_uefi, disk_img, raid=None, iso_img=None, tpm=False
macbase = '00:00:5E:00:53'
cmd = f'qemu-system-x86_64 \
-name "{name}" \
-smp 2,sockets=1,cores=2,threads=1 \
-smp {args.cpu},sockets=1,cores={args.cpu},threads=1 \
-cpu host \
-machine {machine},accel=kvm \
{uefi} \
-m 4G \
-m {args.memory}G \
-vga none \
-nographic \
{vga} {vnc}\
Expand Down Expand Up @@ -546,6 +548,10 @@ try:
c.sendline('systemd-detect-virt')
c.expect('kvm')
c.expect(op_mode_prompt)
c.sendline('show system cpu')
c.expect(op_mode_prompt)
c.sendline('show system memory')
c.expect(op_mode_prompt)

#################################################
# Verify /etc/os-release via lsb_release
Expand Down

0 comments on commit a2fb862

Please sign in to comment.