From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 986DE6A382 for ; Thu, 4 Mar 2021 13:52:47 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8EEE71A5F5 for ; Thu, 4 Mar 2021 13:52:17 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 6C3641A5D2 for ; Thu, 4 Mar 2021 13:52:16 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 318B3462C6 for ; Thu, 4 Mar 2021 13:52:16 +0100 (CET) From: Stefan Reiter To: pve-devel@lists.proxmox.com Date: Thu, 4 Mar 2021 13:52:03 +0100 Message-Id: <20210304125209.24078-2-s.reiter@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210304125209.24078-1-s.reiter@proxmox.com> References: <20210304125209.24078-1-s.reiter@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.024 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH pve-qemu 1/7] add static supported machines file X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 12:52:47 -0000 Same rationale as the CPU flags file, avoids calling QEMU binary just to query machine types. Signed-off-by: Stefan Reiter --- debian/parse-machines.pl | 21 +++++++++++++++++++++ debian/rules | 4 +++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100755 debian/parse-machines.pl diff --git a/debian/parse-machines.pl b/debian/parse-machines.pl new file mode 100755 index 0000000..8ad335d --- /dev/null +++ b/debian/parse-machines.pl @@ -0,0 +1,21 @@ +#!/usr/bin/perl + +use warnings; +use strict; + +my @machines = (); + +while () { + if (/^\s*Supported machines are:/) { + next; + } + + s/^\s+//; + my @machine = split(/\s+/); + next if $machine[0] !~ m/^pc-(i440fx|q35)/; + push @machines, $machine[0]; +} + +die "no QEMU machine types detected from STDIN input" if scalar (@machines) <= 0; + +print join("\n", @machines) or die "$!\n"; diff --git a/debian/rules b/debian/rules index 4a6b472..386ac4b 100755 --- a/debian/rules +++ b/debian/rules @@ -22,6 +22,7 @@ PACKAGE=pve-qemu-kvm destdir := $(CURDIR)/debian/$(PACKAGE) flagfile := $(destdir)/usr/share/kvm/recognized-CPUID-flags-x86_64 +machinefile := $(destdir)/usr/share/kvm/machine-versions-x86_64 # default QEMU out-of-tree build directory is ./build BUILDDIR=build @@ -124,7 +125,7 @@ install: build rm $(destdir)/usr/share/kvm/qemu_vga.ndrv rm $(destdir)/usr/share/kvm/slof.bin rm $(destdir)/usr/share/kvm/u-boot.e500 - # remove Aplha files + # remove Alpha files rm $(destdir)/usr/share/kvm/palcode-clipper # remove RISC-V files rm $(destdir)/usr/share/kvm/opensbi-riscv32-generic-fw_dynamic.elf @@ -138,6 +139,7 @@ install: build # CPU flags are static for QEMU version, allows avoiding more costly checks $(destdir)/usr/bin/qemu-system-x86_64 -cpu help | ./debian/parse-cpu-flags.pl > $(flagfile) + $(destdir)/usr/bin/qemu-system-x86_64 -machine help | ./debian/parse-machines.pl > $(machinefile) # Build architecture-independent files here. binary-indep: build install -- 2.20.1