From patchwork Tue Nov 12 14:50:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 179203 Delivered-To: patch@linaro.org Received: by 2002:ac9:3c86:0:0:0:0:0 with SMTP id w6csp7850927ocf; Tue, 12 Nov 2019 06:53:58 -0800 (PST) X-Google-Smtp-Source: APXvYqzyM8eUMU1g9b0wNo7f05x8TflqYfBHooRoX1nhgt45pnunq0lhz3Yss1W3oOE4AnAvdggr X-Received: by 2002:ae9:f218:: with SMTP id m24mr15865660qkg.305.1573570438647; Tue, 12 Nov 2019 06:53:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573570438; cv=none; d=google.com; s=arc-20160816; b=BejY6waWlfmueJefJf8NPr27QWPxYvtkymIm4+eHOmCSUVmy9F1POAfwxkmIpf30Wz vLbm8a7ihW9ZZ26G3lo9i2jTXyCLwRjyYZYLdHTUnFw0dWvjeYW396JOzB/aTDqJNLBr QL/mv53JdRk8Q7utzakAJ+Idg/LnDgB/RWvMw/QD5+3EWIeIZZDSz2sjs2QOcC8dXG0t awjVxn7lBFPjzeRE/rpPlUVVlspBqYEcL3h/6rVk3SH6wGOINSjwJM7YAFRxn5zzfdEP 0y6XACoH73EIZhxOjA0cOtKq0milH6DCHm/LhEJ24ZUQ1kMkBUichUtAZq08xgz0WV4x py0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=DCQEvHTOo7eYVi9zrwdE9leN9C0uu42dACCPL6An92U=; b=rC0f20lMaKtVME8GO9zyen6T0HGRbHZ5d5zRsMDGQIp4SDnXG+GcsjsTlJ6dmb49LJ wLt9l532edVRuSLVDM/yP7PsBiR7SuDqE339rN51AKukaZ8c0cxuqHqml+xXBUGcaNM4 2ADVjdgi4iyJTw3xr6lJiREnoeCyyGKcPD34rXCeOB4WpkRJO+IA8KSKWgPuZgfjsKZF 6ZV4ff9pLTWdUZyd7OXqiftvH1GB2+lslRJEGp2B04mW9Ca4GpsZv9TtEVugJXfnEaDz CrIausP6IMcnsNDqA4nOeacok/B+LnzX5PM2inFP7O4Evlib8g2hC8gUrUOYhUQLegM4 mjIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=d9QRl+Bn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v2si11071665qth.394.2019.11.12.06.53.58 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Nov 2019 06:53:58 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=d9QRl+Bn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUXYK-0006kT-FP for patch@linaro.org; Tue, 12 Nov 2019 09:53:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59686) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUXV5-0003Os-HJ for qemu-devel@nongnu.org; Tue, 12 Nov 2019 09:50:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUXV3-00032v-LJ for qemu-devel@nongnu.org; Tue, 12 Nov 2019 09:50:35 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:39952) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iUXV3-00032K-Dh for qemu-devel@nongnu.org; Tue, 12 Nov 2019 09:50:33 -0500 Received: by mail-wr1-x42b.google.com with SMTP id i10so18835635wrs.7 for ; Tue, 12 Nov 2019 06:50:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DCQEvHTOo7eYVi9zrwdE9leN9C0uu42dACCPL6An92U=; b=d9QRl+BnlGYgCGLYKC30XWUD9/aIzV7s7WAImJSrMUNmBIDlqCo+opwTQtSABcdEzd LGHWWUB6dsNWQb5rxDX0hdTzjK9xmTZdJOJHxm13UkDKuIjqFH8+V7FowVifETTQHXd2 4rKBjfYO1fHKn7lOwGebUecEAIR/gFlxlrbSogPY1gdXmQClYVAln3xDNmPADAqwp8Lk 9T6X+jE4GoeLXdqP1gMhpwz2HtKO8+KI1K1jiSoepiUNw2sNJRADfagp04Zp39cg5L+0 cv4+o4vf9s8u+3NAEP/Mkt42s48IxrUXzS7eMQ0lWgO1C9PQP1UQWNrwcWpsa3tjud7M mvBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DCQEvHTOo7eYVi9zrwdE9leN9C0uu42dACCPL6An92U=; b=q1bPIZ+3wpYNC8UhdvWFhxpVLek/S2IPv0l/fsh9imwsVyAcnAeThrK8j4gzD7MKkU IuNo06/FrNwkRx4Xh3qMkTaKiOeXGSU2AwDiEd9yKGXsD7HYGVOW2dDNqsiQw9IU6Hrt C5DIU5BCgdmv4uTKMKGtAOAgKJlbPoH5jdhj4eVR4HeyXYLIOym1SNuxuRIIOxnzy+d5 /88sII83DUY46MlbIsr7Ihx67+LNtlDQmr4TQP2zgeW6XvYw4LNCbI4mtI2qWnf5dx41 97MVi/4UV822ORQWVlFurTZguUW4KTYdHot0gWl62KYizXVxVO4VFJttxkAg60y+Nlg3 3j/w== X-Gm-Message-State: APjAAAVxA5kxOwlnE3SnJBcyryxQ0bhSHZ6+JQGpNV20oFbeXJ91FWFT PKrtmcuatz+5keFb1i/lWmkypg== X-Received: by 2002:a5d:5391:: with SMTP id d17mr28113278wrv.382.1573570232116; Tue, 12 Nov 2019 06:50:32 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id x9sm19479286wru.32.2019.11.12.06.50.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2019 06:50:29 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 220B11FF8C; Tue, 12 Nov 2019 14:50:29 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 1/8] tests/vm: netbsd autoinstall, using serial console Date: Tue, 12 Nov 2019 14:50:21 +0000 Message-Id: <20191112145028.26386-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191112145028.26386-1-alex.bennee@linaro.org> References: <20191112145028.26386-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42b X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Thomas Huth , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Kamil Rytarowski , Gerd Hoffmann , Kamil Rytarowski , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann Instead of fetching the prebuilt image from patchew download the install iso and prepare the image locally. Install to disk, using the serial console. Create qemu user, configure ssh login. Install packages needed for qemu builds. Signed-off-by: Gerd Hoffmann Reviewed-by: Kamil Rytarowski Tested-by: Thomas Huth [ehabkost: rebased to latest qemu.git master] Signed-off-by: Eduardo Habkost Message-Id: <20191031085306.28888-2-kraxel@redhat.com> Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé -- 2.20.1 diff --git a/tests/vm/netbsd b/tests/vm/netbsd index 18aa56ae826..445c34dc495 100755 --- a/tests/vm/netbsd +++ b/tests/vm/netbsd @@ -2,10 +2,11 @@ # # NetBSD VM image # -# Copyright 2017 Red Hat Inc. +# Copyright 2017-2019 Red Hat Inc. # # Authors: # Fam Zheng +# Gerd Hoffmann # # This code is licensed under the GPL version 2 or later. See # the COPYING file in the top-level directory. @@ -13,20 +14,53 @@ import os import sys +import time import subprocess import basevm class NetBSDVM(basevm.BaseVM): name = "netbsd" arch = "x86_64" + + link = "https://cdn.netbsd.org/pub/NetBSD/NetBSD-8.0/images/NetBSD-8.0-amd64.iso" + size = "20G" + pkgs = [ + # tools + "git-base", + "pkgconf", + "xz", + "python37", + + # gnu tools + "bash", + "gmake", + "gsed", + "flex", "bison", + + # libs: crypto + "gnutls", + + # libs: images + "jpeg", + "png", + + # libs: ui + "SDL2", + "gtk3+", + "libxkbcommon", + ] + BUILD_SCRIPT = """ set -e; - rm -rf /var/tmp/qemu-test.* - cd $(mktemp -d /var/tmp/qemu-test.XXXXXX); + rm -rf /home/qemu/qemu-test.* + cd $(mktemp -d /home/qemu/qemu-test.XXXXXX); + mkdir src build; cd src; tar -xf /dev/rld1a; - ./configure --python=python2.7 {configure_opts}; + cd ../build + ../src/configure --python=python3.7 --disable-opengl {configure_opts}; gmake --output-sync -j{jobs} {target} {verbose}; """ + poweroff = "/sbin/poweroff" # Workaround for NetBSD + IPv6 + slirp issues. # NetBSD seems to ignore the ICMPv6 Destination Unreachable @@ -36,14 +70,147 @@ class NetBSDVM(basevm.BaseVM): ipv6 = False def build_image(self, img): - cimg = self._download_with_cache("http://download.patchew.org/netbsd-7.1-amd64.img.xz", - sha256sum='b633d565b0eac3d02015cd0c81440bd8a7a8df8512615ac1ee05d318be015732') - img_tmp_xz = img + ".tmp.xz" + cimg = self._download_with_cache(self.link) img_tmp = img + ".tmp" - sys.stderr.write("Extracting the image...\n") - subprocess.check_call(["ln", "-f", cimg, img_tmp_xz]) - subprocess.check_call(["xz", "--keep", "-dvf", img_tmp_xz]) + iso = img + ".install.iso" + + self.print_step("Preparing iso and disk image") + subprocess.check_call(["ln", "-f", cimg, iso]) + subprocess.check_call(["qemu-img", "create", "-f", "qcow2", + img_tmp, self.size]) + + self.print_step("Booting installer") + self.boot(img_tmp, extra_args = [ + "-bios", "pc-bios/bios-256k.bin", + "-machine", "graphics=off", + "-cdrom", iso + ]) + self.console_init() + self.console_wait("Primary Bootstrap") + + # serial console boot menu output doesn't work for some + # reason, so we have to fly blind ... + for char in list("5consdev com0\n"): + time.sleep(0.2) + self.console_send(char) + self.console_wait("") + self.console_wait_send("> ", "boot\n") + + self.console_wait_send("Terminal type", "xterm\n") + self.console_wait_send("a: Installation messages", "a\n") + self.console_wait_send("b: US-English", "b\n") + self.console_wait_send("a: Install NetBSD", "a\n") + self.console_wait("Shall we continue?") + self.console_wait_send("b: Yes", "b\n") + + self.console_wait_send("a: ld0", "a\n") + self.console_wait_send("a: This is the correct", "a\n") + self.console_wait_send("b: Use the entire disk", "b\n") + self.console_wait("NetBSD bootcode") + self.console_wait_send("a: Yes", "a\n") + self.console_wait_send("b: Use existing part", "b\n") + self.console_wait_send("x: Partition sizes ok", "x\n") + self.console_wait_send("for your NetBSD disk", "\n") + self.console_wait("Shall we continue?") + self.console_wait_send("b: Yes", "b\n") + + self.console_wait_send("b: Use serial port com0", "b\n") + self.console_wait_send("f: Set serial baud rate", "f\n") + self.console_wait_send("a: 9600", "a\n") + self.console_wait_send("x: Exit", "x\n") + + self.console_wait_send("a: Full installation", "a\n") + self.console_wait_send("a: CD-ROM", "a\n") + + self.print_step("Installation started now, this will take a while") + self.console_wait_send("Hit enter to continue", "\n") + + self.console_wait_send("d: Change root password", "d\n") + self.console_wait_send("a: Yes", "a\n") + self.console_wait("New password:") + self.console_send("%s\n" % self.ROOT_PASS) + self.console_wait("New password:") + self.console_send("%s\n" % self.ROOT_PASS) + self.console_wait("Retype new password:") + self.console_send("%s\n" % self.ROOT_PASS) + + self.console_wait_send("o: Add a user", "o\n") + self.console_wait("username") + self.console_send("%s\n" % self.GUEST_USER) + self.console_wait("to group wheel") + self.console_wait_send("a: Yes", "a\n") + self.console_wait_send("a: /bin/sh", "a\n") + self.console_wait("New password:") + self.console_send("%s\n" % self.GUEST_PASS) + self.console_wait("New password:") + self.console_send("%s\n" % self.GUEST_PASS) + self.console_wait("Retype new password:") + self.console_send("%s\n" % self.GUEST_PASS) + + self.console_wait_send("a: Configure network", "a\n") + self.console_wait_send("a: vioif0", "a\n") + self.console_wait_send("Network media type", "\n") + self.console_wait("autoconfiguration") + self.console_wait_send("a: Yes", "a\n") + self.console_wait_send("DNS domain", "localnet\n") + self.console_wait("Are they OK?") + self.console_wait_send("a: Yes", "a\n") + self.console_wait("installed in /etc") + self.console_wait_send("a: Yes", "a\n") + + self.console_wait_send("e: Enable install", "e\n") + proxy = os.environ.get("http_proxy") + if not proxy is None: + self.console_wait_send("f: Proxy", "f\n") + self.console_wait("Proxy") + self.console_send("%s\n" % proxy) + self.console_wait_send("x: Install pkgin", "x\n") + self.console_init(1200) + self.console_wait_send("Hit enter to continue", "\n") + self.console_init() + + self.console_wait_send("g: Enable sshd", "g\n") + self.console_wait_send("x: Finished conf", "x\n") + self.console_wait_send("Hit enter to continue", "\n") + + self.print_step("Installation finished, rebooting") + self.console_wait_send("d: Reboot the computer", "d\n") + + # setup qemu user + prompt = "localhost$" + self.console_ssh_init(prompt, self.GUEST_USER, self.GUEST_PASS) + self.console_wait_send(prompt, "exit\n") + + # setup root user + prompt = "localhost#" + self.console_ssh_init(prompt, "root", self.ROOT_PASS) + self.console_sshd_config(prompt) + + # setup virtio-blk #1 (tarfile) + self.console_wait(prompt) + self.console_send("echo 'chmod 666 /dev/rld1a' >> /etc/rc.local\n") + + # turn off mprotect (conflicts with tcg) + self.console_wait(prompt) + self.console_send("echo security.pax.mprotect.enabled=0 >> /etc/sysctl.conf\n") + + self.print_step("Configuration finished, rebooting") + self.console_wait_send(prompt, "reboot\n") + self.console_wait("login:") + self.wait_ssh() + + self.print_step("Installing packages") + self.ssh_root_check("pkgin update\n") + self.ssh_root_check("pkgin -y install %s\n" % " ".join(self.pkgs)) + + # shutdown + self.ssh_root(self.poweroff) + self.console_wait("entering state S5") + self.wait() + os.rename(img_tmp, img) + os.remove(iso) + self.print_step("All done") if __name__ == "__main__": sys.exit(basevm.main(NetBSDVM)) From patchwork Tue Nov 12 14:50:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 179200 Delivered-To: patch@linaro.org Received: by 2002:ac9:3c86:0:0:0:0:0 with SMTP id w6csp7850304ocf; Tue, 12 Nov 2019 06:53:23 -0800 (PST) X-Google-Smtp-Source: APXvYqzz5yr7TTPObp0Kw2wDIsEPuVIM7E+lUIcll5/FukZrGMwzg2uB26SIV2H7X7LvSY+wCabk X-Received: by 2002:a05:620a:158b:: with SMTP id d11mr5939040qkk.452.1573570403065; Tue, 12 Nov 2019 06:53:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573570403; cv=none; d=google.com; s=arc-20160816; b=oWSXzH4AebNgCDJFTCu4yW+mYagoDBqxiILL8mr1tpgTh2wlAd3ze/Qtb1xJBWdtp8 mCqCmENPqRKfa8nQUnJDrtIN8eyewPu/64/e8qrjpA5axsie4qyTIbte4fbqDGkR0Pl2 N6iKbUMHLzfHn71az/OMdbzbe52ncnnUeZqEnqhdUPSv5MPq9I4uE90hIKtohGnNPXNP /IFTAGNamoLLy9Ii3BqjenGG5xDe4ewOryr4UhA9Wt9MZUFXw7SENc/s6c171bDeVBjn KgBlZyh7Z4+HHV77TMDitDflmf953eEeR55rqypj/2x0hCsKKVecCL9VBpx+/tiBXVe6 vZFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=SGYCyiXxj6y3DiaxBTG3xzzW6T9viHeKAsigKYTsu2c=; b=0m7B+HvWyWhP6qWYZg8u7Om/4b+N1LA4y1phVobvHsEn5Ql1Qwe3cQTK+TCe1AyHdr Nebzxl4YvWO/GGTkqUTkZYIv1MjMp4i3e/96rc4G0PgHFQOK1FFgJ7nvUrPCZB+ZFGy+ clQtq9gcfH2xssd2bril6IYkRRpWVkjbKxTBv1rnBcebXHWzb18teCCXFdPwKI2b6Mia auS65a/O13Xz9rOmXXHaISt9k4pYKGdkm9zw2dkQI5aiDtBF096TEjEeLV+o5XNZ43HH hlCh/76PezjQ1f+A4tANRR8vyjtcom5rpADLlqrHAlAlAkWj8EYH43ZtzBwl5teMfnoz U/Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=By6FVuPA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y19si5577130qka.120.2019.11.12.06.53.23 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Nov 2019 06:53:23 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=By6FVuPA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUXXm-0006dJ-9k for patch@linaro.org; Tue, 12 Nov 2019 09:53:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59688) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUXV5-0003P4-NN for qemu-devel@nongnu.org; Tue, 12 Nov 2019 09:50:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUXV4-00033l-O2 for qemu-devel@nongnu.org; Tue, 12 Nov 2019 09:50:35 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:38033) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iUXV4-00033H-Hr for qemu-devel@nongnu.org; Tue, 12 Nov 2019 09:50:34 -0500 Received: by mail-wm1-x333.google.com with SMTP id z19so3253715wmk.3 for ; Tue, 12 Nov 2019 06:50:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SGYCyiXxj6y3DiaxBTG3xzzW6T9viHeKAsigKYTsu2c=; b=By6FVuPAO3hW+33sD4y/FG/PozqoAeSCi2REuBa0rN+OhK2Aft9JA9EaxNpeAx9DHF q8RmGMD6BATwI80V56nvsOyTSlyTmW0WoNekzf9kP1q3Y+Lh+JvJ6x6A9+dLHc3V9kzO uj5NBC1P2gE3kgNHrwmqfRQS77jzCZYmprt5MXt2risz0SohRlxyyO5/wRV7yi38MuUW OwQhynYrZzFxbC5Guw5ewvU2beIvYSym0LBOYDLja/fh1BOlZqyI90JeAZzmgjlE3utw o8m6fCp6SUHfMg8M/f1wNb6VfPIYt2SCaQl+/CraeZ4e9kN0gX/7tKGVKLoYd5rLYv9r rl3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SGYCyiXxj6y3DiaxBTG3xzzW6T9viHeKAsigKYTsu2c=; b=mTJ+mWGyy9AjRUSHWvMDvbhAlv4aPuB46cyuS66txRhE9pzfJ6AxC1Rkt65NbzmghC JAFwYqykJEbWsQipfJCA67+afoFJoBlj2C0o0e+c7+oza2DZ2f0NxmEWi4r47/Bm8ial P+4LXrYfQD0z1emk86tE2b+A1+YwPDVpNagu9iLiUPUzW1Hy/9oWVT+znrY/1J6wnRcv y+9XZrA5bLdK9fo+SMw/a/Wv/qlt4J+CF+tze21D++KOqEEIOMQLNxlsquSl7YoqFNBE 6NcyRmFaIMObY/qDJwG4bW4U7WHJnPKjpCDRJEQttvBvKT6PcYm/V86HQ/0dcKQWmfbx xfFg== X-Gm-Message-State: APjAAAVWrN40xwRGpfFj2kkkK78Oj9FJbBZcT5zuO6nMbtlG0LFP97lG BiL3pEScm+deu0RnhYY3BpkW7A== X-Received: by 2002:a1c:810d:: with SMTP id c13mr4674846wmd.154.1573570233426; Tue, 12 Nov 2019 06:50:33 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 16sm3669610wmf.0.2019.11.12.06.50.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2019 06:50:30 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 385061FF8F; Tue, 12 Nov 2019 14:50:29 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 2/8] tests/vm: add console_consume helper Date: Tue, 12 Nov 2019 14:50:22 +0000 Message-Id: <20191112145028.26386-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191112145028.26386-1-alex.bennee@linaro.org> References: <20191112145028.26386-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::333 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Gerd Hoffmann Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann Helper function to read all console output. Signed-off-by: Gerd Hoffmann Message-Id: <20191031085306.28888-3-kraxel@redhat.com> Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé -- 2.20.1 diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 2929de23aa7..086bfb2c66d 100755 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -242,6 +242,25 @@ class BaseVM(object): return False return True + def console_consume(self): + vm = self._guest + output = "" + vm.console_socket.setblocking(0) + while True: + try: + chars = vm.console_socket.recv(1) + except: + break + output += chars.decode("latin1") + if "\r" in output or "\n" in output: + lines = re.split("[\r\n]", output) + output = lines.pop() + if self.debug: + self.console_log("\n".join(lines)) + if self.debug: + self.console_log(output) + vm.console_socket.setblocking(1) + def console_send(self, command): vm = self._guest if self.debug: From patchwork Tue Nov 12 14:50:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 179205 Delivered-To: patch@linaro.org Received: by 2002:ac9:3c86:0:0:0:0:0 with SMTP id w6csp7853716ocf; Tue, 12 Nov 2019 06:56:28 -0800 (PST) X-Google-Smtp-Source: APXvYqz+87dbyuY5BNN3/gRDXIYQP5oOEU+jHL8MXF9o56PLMTxgsSjO8c1sID6nYJw1Bq464Xg1 X-Received: by 2002:a37:9d96:: with SMTP id g144mr15995334qke.93.1573570587926; Tue, 12 Nov 2019 06:56:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573570587; cv=none; d=google.com; s=arc-20160816; b=fP2fD08I28R3I+HL1NiBTH9Vf5JO7a535GWNQ40hCVJgTCm+ZpzpyJaqH1Qhu935iu H6YIKVAUFE6pBnBLBwly9ugwGl+GdDRRqiHYWeI1B/Fj904fgDWm733qUFkKybEnSiBC m07zL30K2Fj6R/oSBdztHrQJz7SBKkAzr3yyObh+dLBbmBmDSVeFvZhUIX2H7Q9ZysnN x8UMJ6TvBPwnoKdxLa/hPcMdvrfFvXJztgLIyPYi6TMWm2xgvWCFb5nv2OsYUfMr2ght e2y9L/FJQ5y4wMq/bpJQz2EI/Ylt9k96TM0/4buza09/dGVJ4U+QjRsHYa58hyNktrxt YyVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=MgNvQL45Hwg6psU5bHdK3yy5lx6MA/Ql526zQmB9a9Y=; b=ZdE1CYsnuLjc2HK0z0ddqxf1qKLsq4ByN9sTxqdWBI+k+tVMb4T/kigU5WeBQsnar1 xAHBhCWDVC0EEr+4hVpfcEghjcyvo0E6Vk0tElrnl/15BOAwsWkRU+77Fa7s/kLAWPd9 fh1h33O1LEPiDuinJbaJWCdbzvb35yIyGUvg7hj2r09DIczhg0EtMWMA7K7yxNqb07JB wwz87smNM4c+uSn5Cycz+CY3dFLMIarxIEOWpD0T9m1GfFnW5+rnEd59FIvfRHE3EVnh j/N5wW7cQ13wzO3WnROM+zBv+AM+VKD9opKlsTOxuzEPxGDCZi7+Mw0YgC2EULmz7icd wSKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=trNSRwzD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m56si11040487qta.375.2019.11.12.06.56.27 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Nov 2019 06:56:27 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=trNSRwzD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUXal-0001eZ-3T for patch@linaro.org; Tue, 12 Nov 2019 09:56:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59705) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUXV6-0003QH-SN for qemu-devel@nongnu.org; Tue, 12 Nov 2019 09:50:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUXV5-00034R-VM for qemu-devel@nongnu.org; Tue, 12 Nov 2019 09:50:36 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:50404) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iUXV5-00033y-PR for qemu-devel@nongnu.org; Tue, 12 Nov 2019 09:50:35 -0500 Received: by mail-wm1-x329.google.com with SMTP id l17so3522976wmh.0 for ; Tue, 12 Nov 2019 06:50:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MgNvQL45Hwg6psU5bHdK3yy5lx6MA/Ql526zQmB9a9Y=; b=trNSRwzDOM+I+w+H1MxuC9KDatbbPZHcdX1vR1zCVnPcELDa5FlIyl86mtiuXyaDET GijOzm/Yn8ZtLPzvnZfhE4Eh/7j8bwwId1BH+EX6G48sBjXZAMqchAxIX+zLw+pDLhd5 CQx3ZFMHdxctmz5vcfmw5siihbpO50oizgvSoWCn1nuDkT9tvRFVhdWz2jU/I0UsttRC QaR0FEz9qRzf621VE+5+G6LPyMv4sY641mb+iXb1lu2tAh7c/pMH/EZRTTctRXHXMaOl CLKdeBH4nk6GtCWFvWQQT3vZ8lErALR9IgVRt+4WV9sQJZZCyYycfHkdpq+/Ho4tI5At Isng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MgNvQL45Hwg6psU5bHdK3yy5lx6MA/Ql526zQmB9a9Y=; b=EZFlGrLWpG3r+Jkg4marebtaQVmjPkPFaX0en4/Xu6+s+D/fG59Qy6qW2ivZh4379T uX0bnRlumXY0LWfgVWmN8CROK5x99fxk174cpC2rM0Vg1KRCJthmLPNshYY1dSemnATG H5MUgyACIuZW/Hz2ZxF72mbx9cojVpY+BGq4WWc3uO82eJoye4CBm8Y1rww/8fK5KagQ Otru7X9QXBdq/0dxNKAZq0VLy1/t8wdAcXWjv6qiDBQwZue8UCID/A+63H7iBq8cSfrz 6s2QTtE/rGHAxDd3h/DAZNxOQliACIHdXPvBKq6NAw3avIFbFZXpcCXNL/QzGt5hJBN5 PuLg== X-Gm-Message-State: APjAAAV1gShs/FQ3AEO4CYdj+IZftm/mI76wobBQFNq/0eID8yrjhTZx HJddvV7bqugiysZRsnf8FzOyGw== X-Received: by 2002:a7b:c7d3:: with SMTP id z19mr4509359wmk.98.1573570234658; Tue, 12 Nov 2019 06:50:34 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 36sm26795482wrj.42.2019.11.12.06.50.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2019 06:50:30 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4DC681FF90; Tue, 12 Nov 2019 14:50:29 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 3/8] tests/vm: use console_consume for netbsd Date: Tue, 12 Nov 2019 14:50:23 +0000 Message-Id: <20191112145028.26386-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191112145028.26386-1-alex.bennee@linaro.org> References: <20191112145028.26386-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::329 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Kamil Rytarowski , Gerd Hoffmann , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann Use new helper to read all pending console output, not just a single char. Unblocks installer boot. Signed-off-by: Gerd Hoffmann Message-Id: <20191031085306.28888-4-kraxel@redhat.com> Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé -- 2.20.1 diff --git a/tests/vm/netbsd b/tests/vm/netbsd index 445c34dc495..0083f7ff6a7 100755 --- a/tests/vm/netbsd +++ b/tests/vm/netbsd @@ -93,7 +93,7 @@ class NetBSDVM(basevm.BaseVM): for char in list("5consdev com0\n"): time.sleep(0.2) self.console_send(char) - self.console_wait("") + self.console_consume() self.console_wait_send("> ", "boot\n") self.console_wait_send("Terminal type", "xterm\n") From patchwork Tue Nov 12 14:50:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 179206 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp8227722ilf; Tue, 12 Nov 2019 06:57:53 -0800 (PST) X-Google-Smtp-Source: APXvYqy5VJfelksQDy1Px8/Kf7mPYBATwHPAAtl4MueQqyWkAYeFOBgV2Mt5NsfliKDJLBk8jIWD X-Received: by 2002:ac8:f6a:: with SMTP id l39mr32155789qtk.145.1573570673318; Tue, 12 Nov 2019 06:57:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573570673; cv=none; d=google.com; s=arc-20160816; b=0zlIQzUlkgxodLmgwOsflmBZihdsKWb4hV9O6Q1+djs2tGlfNnsE82FSjY4RkhuSp9 El2cu3oDyNA8NnPUcHYBLi92fex+uKEwCWpZEUv1pMxzXS+YATXmghwbdQmY+9rnKUTz 7wirZPW3DAgIES2ei7uWrYq2K/jv6IhI0uHDB96HdrLLLh5KVEA/uq5mhXbwG9ss5KKd lOrdpRN5n/iHDHm85A7BRM7He82i45XuSjBtTrTKUKY0Y1H1NHBolsdX2adZ/+Au6RFo ypOG4NMgilGGVcFjIhpc7erbXi1OC0fTTlBao7+1KWul36DotJlo99f19Hy+XoPlCp3Y yiOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=KwclHsri8LmcLI50PiGGlusR9EB2W9H/laTcrk7KH84=; b=WuQwNpATVee9hTTd/uQfVIAJg30wAIN7tyeeyzk+7ftGnpqudG4oH2yYkku7xYLbAm mLPXQgYa5J2KC33tmUolpcNDs7JszLi9gOybadOIVCij2ckK3reQOaEQcsD/6MokhpDL 90mwCOWpnW2/fw1v3goj3S8WVnMUqF14odoUPf3fZ5mL3/1nLWodBKwBRU8P7UYLg8MS qsg9XSITJ1wovDIMQId+b8/AxtcnKq3s3CWBjNBDSB99ydo0DUh6zQDV0izZpzE/yo/0 K+vP1SZIhxX/En87qn3QMgEBJ/3/bw8ocjAxufeGjjliWbROYckbH26y2vrJCB6cz4D3 y7rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=llKqRYuF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n47si11146629qtc.52.2019.11.12.06.57.53 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Nov 2019 06:57:53 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=llKqRYuF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUXc8-00038S-U1 for patch@linaro.org; Tue, 12 Nov 2019 09:57:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59725) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUXV8-0003SZ-8s for qemu-devel@nongnu.org; Tue, 12 Nov 2019 09:50:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUXV7-00035A-42 for qemu-devel@nongnu.org; Tue, 12 Nov 2019 09:50:38 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:37267) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iUXV6-00034f-UH for qemu-devel@nongnu.org; Tue, 12 Nov 2019 09:50:37 -0500 Received: by mail-wm1-x32f.google.com with SMTP id b17so3265376wmj.2 for ; Tue, 12 Nov 2019 06:50:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KwclHsri8LmcLI50PiGGlusR9EB2W9H/laTcrk7KH84=; b=llKqRYuFmltnlWlwuRcDU/M/P/QDcQIOmcthPeo73idJ4OeK1K3eF7phISpYNGU1YO IZNgruGetqUsL5DTZiFWkJsS84P9OdvC0jKbC43Uu3XkU5Lx6UsD1G7juaEePZwFzqeF UDFYFylbK4H6B/USvXdXeR7gKHYDVB6r3dHmXBWVwCsl5v2G0zSFUgSciNHxFXq1V866 hhHLSxgEzieLCrjs5KoygkPP8M5nfPTcPTLszWDHYWxUbJasqAV2TPoVm0CTQPqfo96O Y4SqMtC9SLzTcvZsLoV0KamCAsCrVL5BpB0srF8yIu9HlIKgT34O10yqS7O9skfvphmP BErQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KwclHsri8LmcLI50PiGGlusR9EB2W9H/laTcrk7KH84=; b=d7ZRkQPPBFR4NnAoXjRGOzcW7IbGuh+9sfEqNB+WZGil5AGn1GRoq8uXw30ZO+N9O1 CECL+dux9IM+5S47QHbgHgi+jc7htuzAw/r224vnJ5wygJvi//YwR6QoDenfYVA/tNOq OCwH+uxBnt3YvPfMKQ98AsBFvklv9+qgd9PwXuWgZhfDc6iKENQJE7Fvnn9w8rvZt8yo Dx89h2/ua6xz5p4DV9p0AodEHVtW39p1SXjXk0Z39QC1CymSKGgKvCAFcVHYjpPlURgP 1lTb+i5oqjl8VuuDpzyjVsPxSgKARxYTbpSLa0sv4tqKgnVdTJUA5FIK1w0Azw0J6UHe qyRA== X-Gm-Message-State: APjAAAX1IS1DNc5V10/U+iU8ZQZoVBxhypMJxBxO+QNal6JrcVIRkHxV 26OFzclxoh0GToJeZIhd0fEKc2IJQy0= X-Received: by 2002:a1c:67d7:: with SMTP id b206mr4224157wmc.68.1573570235820; Tue, 12 Nov 2019 06:50:35 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id y6sm14052312wrn.21.2019.11.12.06.50.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2019 06:50:30 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 62FFC1FF91; Tue, 12 Nov 2019 14:50:29 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 4/8] tests/vm: update netbsd to version 8.1 Date: Tue, 12 Nov 2019 14:50:24 +0000 Message-Id: <20191112145028.26386-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191112145028.26386-1-alex.bennee@linaro.org> References: <20191112145028.26386-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32f X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Kamil Rytarowski , Gerd Hoffmann , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann Signed-off-by: Gerd Hoffmann Message-Id: <20191031085306.28888-5-kraxel@redhat.com> Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé -- 2.20.1 diff --git a/tests/vm/netbsd b/tests/vm/netbsd index 0083f7ff6a7..c48c60853e7 100755 --- a/tests/vm/netbsd +++ b/tests/vm/netbsd @@ -22,7 +22,7 @@ class NetBSDVM(basevm.BaseVM): name = "netbsd" arch = "x86_64" - link = "https://cdn.netbsd.org/pub/NetBSD/NetBSD-8.0/images/NetBSD-8.0-amd64.iso" + link = "https://cdn.netbsd.org/pub/NetBSD/NetBSD-8.1/images/NetBSD-8.1-amd64.iso" size = "20G" pkgs = [ # tools From patchwork Tue Nov 12 14:50:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 179202 Delivered-To: patch@linaro.org Received: by 2002:ac9:3c86:0:0:0:0:0 with SMTP id w6csp7850492ocf; Tue, 12 Nov 2019 06:53:32 -0800 (PST) X-Google-Smtp-Source: APXvYqxiqhCqDxP/zVQTCWIzJvXsmBP+uQzCXRix36NZUqjWpaCyexa9HH6tD1lwoN1zWvOgAeZ2 X-Received: by 2002:a37:bf83:: with SMTP id p125mr15682798qkf.165.1573570412559; Tue, 12 Nov 2019 06:53:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573570412; cv=none; d=google.com; s=arc-20160816; b=InzoI72WP9hpdKe8FDKH/ENDIwM0h7uUlxk3rYLAUnjNohSgITwuqnWjThQAjN3S3B bLAj7X+0ABbUGFUh7pynxz5E61zqZGEda/gwffgM+L1Unn+BY7vlr27CYO4aHAm11mJE r5bUc/sA2KLIEuf7lpnGjZvsUdDn6NU22jpaVrtnOJrPjrbUZgYDOX8JYF9GZhWf0Kvc HFHx1Z5iIhPnx+4KS4ltycxzocf7sn8tmrvXONwhPXnnc9Nr6QHNAH7VUlH9Hsng330k Y/LWmALFLVmitfzjleAVvy4oxXxhFqOwaLmrrjFWJ/wk1PLSlEz6/8QOvXkRBOgHhSts WcrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=C/T551LsoJCqT8PPcigQnHg90m+bDpmj3ecZkZBc7lc=; b=Bj4QfYUus6LbLvE+h5enTZ+uAHpmczYrtzdK6z76mw76wEb5i5kRZLQTPBv1/jQkof QtSAlp25e8rICLfF27RAET3MenPDN9v9/zuVfN3Ab8V09qsaqFxCMT9JrgEjrfmZJ7mQ tiRjWYs7eFdTYZIiolLK71eTH8UdXDFuvTPnVKKjDC5r2y98Sg3C2FCRsSPubf76p8ks jIF8EkUr3+ZnhA74XiH/oQi45XVV2V3YOZ0exrzaCcfslrsO1vU430TAa6a1lTEKbdcl ZRVJ/ZQauGudE3WcfVzHLAgKqRwWEVUROOqQwR9sP2Wsr6HdulErSGG/dIBg6dp5WUV8 L5iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JVc+NfAo; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 184si5532204qkm.366.2019.11.12.06.53.32 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Nov 2019 06:53:32 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JVc+NfAo; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUXXv-0006qS-BG for patch@linaro.org; Tue, 12 Nov 2019 09:53:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59756) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUXVC-0003W9-2R for qemu-devel@nongnu.org; Tue, 12 Nov 2019 09:50:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUXVA-00036S-VB for qemu-devel@nongnu.org; Tue, 12 Nov 2019 09:50:41 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:39956) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iUXVA-00035g-PB for qemu-devel@nongnu.org; Tue, 12 Nov 2019 09:50:40 -0500 Received: by mail-wr1-x42e.google.com with SMTP id i10so18835998wrs.7 for ; Tue, 12 Nov 2019 06:50:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=C/T551LsoJCqT8PPcigQnHg90m+bDpmj3ecZkZBc7lc=; b=JVc+NfAoiQaF4ZZB6o3dl19lcJOqKkMe6chwTm/qJUAkjE0sQ4vaAZluE+6gMI5aZu 1a36F2vgnbh52FSKCaxhf6smlbrhIyUm2z1EWtgEXPAnjJi1oYOet96rnQdK3sU/o+UB +hhmqMpcpF48TvY4eOsj3FDINXUubbghAc31nVcfmGS1a4T1DWcIvKmO4gHSj6TBiqH+ SyYKBo9Kaqx+5MSjUMD3CNollxutZhoQdHV8E4iXE/qZ8yiLQcBleDQi3iyOkLYCHSoX /4Vj656E+dKsK0eQnFKR3Fr1KhrZ+XWVLoFCqbPupPcz6/ehl24hvFQjRsO3pvP47Wzm Efgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=C/T551LsoJCqT8PPcigQnHg90m+bDpmj3ecZkZBc7lc=; b=Yzmkc7+euedFU4D8OnGH4kSU1LM9JvxE3P6LJbjST8kgPrgAilB0lYW5RZrHcBZfjJ btxQ2HCkOmP9XtiD52MKgvgtG/tJgV3uRSdGttR2Re1ok9zfIoJMXuiqbZ/bMKEXTm9/ H6H5m29BvIuQFjYkZWT9k5d7bPhTtydepr1ovj+loMtSGtvNjajHp2rVjopiRtK6OEYr FydKJymyS+Q0NaaseBnp+ttY0AFxiMX7s2LaSluLeIfK06v9dKbeXPb9RBFH+Jg0Hptu P+KnOGvFhMaqQfAWUy9RumZ6ARi7i0CtfDxUXdKK1bVLbo5VsRZ4Uckdb+FIrw4ByzUr 0nAQ== X-Gm-Message-State: APjAAAXtYjLzF6D+y36rZv/JSGZpWYNi3cN9ioG8xZfb9ma3WRc4W9Ir Pv1T47DBzgwsmX9ei0LScCqg7Q== X-Received: by 2002:adf:f5cf:: with SMTP id k15mr7830943wrp.265.1573570237684; Tue, 12 Nov 2019 06:50:37 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id z11sm24615674wrg.0.2019.11.12.06.50.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2019 06:50:35 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 76BD41FF92; Tue, 12 Nov 2019 14:50:29 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 5/8] tests: only run ipmi-bt-test if CONFIG_LINUX Date: Tue, 12 Nov 2019 14:50:25 +0000 Message-Id: <20191112145028.26386-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191112145028.26386-1-alex.bennee@linaro.org> References: <20191112145028.26386-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42e X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Corey Minyard , Kamil Rytarowski , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This test has been unstable on NetBSD for awhile. It seems the mechanism used to listen to a random port is a Linux-ism (although a received wisdom Linux-ism rather than a well documented one). As working around would add more hard to test complexity to the test I've gone for the easier option of making it CONFIG_LINUX only. Signed-off-by: Alex Bennée Cc: Corey Minyard Cc: Kamil Rytarowski -- 2.20.1 diff --git a/tests/Makefile.include b/tests/Makefile.include index 534ee487436..8566f5f119d 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -177,7 +177,9 @@ check-qtest-i386-$(CONFIG_SGA) += tests/boot-serial-test$(EXESUF) check-qtest-i386-$(CONFIG_SLIRP) += tests/pxe-test$(EXESUF) check-qtest-i386-y += tests/rtc-test$(EXESUF) check-qtest-i386-$(CONFIG_ISA_IPMI_KCS) += tests/ipmi-kcs-test$(EXESUF) +ifdef CONFIG_LINUX check-qtest-i386-$(CONFIG_ISA_IPMI_BT) += tests/ipmi-bt-test$(EXESUF) +endif check-qtest-i386-y += tests/i440fx-test$(EXESUF) check-qtest-i386-y += tests/fw_cfg-test$(EXESUF) check-qtest-i386-y += tests/device-plug-test$(EXESUF) From patchwork Tue Nov 12 14:50:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 179204 Delivered-To: patch@linaro.org Received: by 2002:ac9:3c86:0:0:0:0:0 with SMTP id w6csp7851012ocf; Tue, 12 Nov 2019 06:54:03 -0800 (PST) X-Google-Smtp-Source: APXvYqy6nKtugVCg3DLDNTv8gACpLFRi0LRWd0CzkQOwZ5K05ejkrpxB0S0LeFIBZPzPLVc7E4dq X-Received: by 2002:ac8:2dc9:: with SMTP id q9mr32681816qta.219.1573570443740; Tue, 12 Nov 2019 06:54:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573570443; cv=none; d=google.com; s=arc-20160816; b=dK2vGwTlmkRaDjhzMVsaCjAbZTADlwWlUt10ys+W++jKoaqtNr174wA+NCJ1Dh3bpd aVFBsVQ3/tl8My2Y4cTsXSr/8zQghhnBCBvqV9G6YUD1CksDqtkbiMZLpmj+EVabDx9R JN2RTD5cMEnSKV5CKnpA4j9i6lORCNqmZkAlHXJi9qavfFTU6k9F7ajxu3ZkLgQ4LPXG qbpWiT86fTfDhJ9hA86DokLsnc6XkjeyPulHHLB46WhoXmLtty22kTERiOWeBic2+Ilt z+cGTyJUJoOs5UG53InYdfAF30TEN6/C/shMEUYJYoql/4uTHwI4cCaBUwMfYUlWPXh9 d9KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=OuBID0cJqkigSPofx9+aC0NVHfNM9AtTCEr/b96Ovls=; b=AjzOBXObDLvZ3mPGDIYpDolnAPXKPB9R3h6sw77C5R9f9rNv2JsTg5VvExrAaDAZSz UJU7fSdpvh3S7Dx6/2fICiJrWZtvyvDXpqHPXiYQn3UMuLNidjL8bg9/oqAJUFKeazby aM+KVgE72FQLiLL5vGrq1fVDDS3TrasjgGWfiU8EctHZrsLpb9XOZVMT+lXzOI5ZcdcE Sa6RvdUzT6gNyjAsBH9Ge7ZDmScGK8jbX1cq6x7Fzqt+L6DKL3JO2b2at0VPf+zZlekZ lLFR5ksw9dBG0bv8mWpObS0GW1hMHcoovAj5Q00qaHvw0HOmGNk8sSlIzFiE4uOUOE9i P/5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=eh4Liq78; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z2si10670492qvx.145.2019.11.12.06.54.03 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Nov 2019 06:54:03 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=eh4Liq78; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUXYQ-0006vx-SZ for patch@linaro.org; Tue, 12 Nov 2019 09:54:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59767) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUXVC-0003X9-LD for qemu-devel@nongnu.org; Tue, 12 Nov 2019 09:50:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUXVB-00036j-Af for qemu-devel@nongnu.org; Tue, 12 Nov 2019 09:50:42 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:39611) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iUXVB-00035s-3v for qemu-devel@nongnu.org; Tue, 12 Nov 2019 09:50:41 -0500 Received: by mail-wr1-x436.google.com with SMTP id l7so7265691wrp.6 for ; Tue, 12 Nov 2019 06:50:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OuBID0cJqkigSPofx9+aC0NVHfNM9AtTCEr/b96Ovls=; b=eh4Liq78aWKNj3ut3flg/QtyGPjidZUrYm/7rObzK7AEItIjVFcq2nEAgXUGIm6nzE olyra1ItCQjBgNIq2Q32/ogAwZlUix/0t8HlMoEfvmgi8GkRpYjYXvONrrH1V4M78pX1 Z/jV5ij7ZShlM4Q3gpmwOLcrwX1oe+mbD6p+jfq7R2wegnRTAKKCe+702lic+JqcHT4n 1038Iv+LbXafXLFe4usUOaS9Kg9zBZ4h/63ccbpO5FC+ND804KJ+HazhZsqw+kRIZScZ OwmdFuaww9VJfr/l8/TkH09Du9fGu4dIXsZwNNmzt55vvw1UHnqr2mcNBM6JO4iUkMzF okxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OuBID0cJqkigSPofx9+aC0NVHfNM9AtTCEr/b96Ovls=; b=LUkiKEvhr8XVDrsAlM2Bq9tNTwWrWJ9Ab9HwLVTHSAFuphKau+/4qekOMRnlaj8BTy 2MTYftPXYR3jwdKTXSuk2Ki20KsCGUm8qiIdCy2FoewbBIa/7wqdmo84Jc2zys8epcbS AfLB99OXq3RdRHv7+ZoWhUIUChmGHnCMcXI0nSl9IzshbkflMpdIbtMWwWb2ibIj1OP2 cGLMi+dMcINCwX4I8bT/6OGYoaG/ZG1p2BhdmVTq1MjysFJ25opp0oO+220cjLsgndGo nrUWaPHeeKjYxZIb7NmdzUkcz6SfKhM31Uvz4JKm3eaJmDwgJ8ZC1B3FQFLJcahbCSHe 2XOg== X-Gm-Message-State: APjAAAXTytTTc9pUZ1zMyIuOz2+4skHX2uvtW0DBBMuRAHCdNvqYz/fL 6WRVL47voEa/Xmf9bGzIXEyy/Q== X-Received: by 2002:adf:dc06:: with SMTP id t6mr26944129wri.378.1573570238599; Tue, 12 Nov 2019 06:50:38 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id q15sm18905974wrr.82.2019.11.12.06.50.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2019 06:50:35 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8E4131FF93; Tue, 12 Nov 2019 14:50:29 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 6/8] tests/vm: support sites with sha512 checksums Date: Tue, 12 Nov 2019 14:50:26 +0000 Message-Id: <20191112145028.26386-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191112145028.26386-1-alex.bennee@linaro.org> References: <20191112145028.26386-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::436 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The NetBSD project uses SHA512 for its checksums so lets support that in the download helper. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé -- 2.20.1 diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 086bfb2c66d..91a9226026d 100755 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -95,19 +95,25 @@ class BaseVM(object): logging.info("KVM not available, not using -enable-kvm") self._data_args = [] - def _download_with_cache(self, url, sha256sum=None): + def _download_with_cache(self, url, sha256sum=None, sha512sum=None): def check_sha256sum(fname): if not sha256sum: return True checksum = subprocess.check_output(["sha256sum", fname]).split()[0] return sha256sum == checksum.decode("utf-8") + def check_sha512sum(fname): + if not sha512sum: + return True + checksum = subprocess.check_output(["sha512sum", fname]).split()[0] + return sha512sum == checksum.decode("utf-8") + cache_dir = os.path.expanduser("~/.cache/qemu-vm/download") if not os.path.exists(cache_dir): os.makedirs(cache_dir) fname = os.path.join(cache_dir, hashlib.sha1(url.encode("utf-8")).hexdigest()) - if os.path.exists(fname) and check_sha256sum(fname): + if os.path.exists(fname) and check_sha256sum(fname) and check_sha512sum(fname): return fname logging.debug("Downloading %s to %s...", url, fname) subprocess.check_call(["wget", "-c", url, "-O", fname + ".download"], diff --git a/tests/vm/netbsd b/tests/vm/netbsd index c48c60853e7..611e6cc5b5c 100755 --- a/tests/vm/netbsd +++ b/tests/vm/netbsd @@ -23,6 +23,7 @@ class NetBSDVM(basevm.BaseVM): arch = "x86_64" link = "https://cdn.netbsd.org/pub/NetBSD/NetBSD-8.1/images/NetBSD-8.1-amd64.iso" + csum = "718f275b7e0879599bdac95630c5e3f2184700032fdb6cdebf3bdd63687898c48ff3f08f57b89f4437a86cdd8ea07c01a39d432dbb37e1e4b008f4985f98da3f" size = "20G" pkgs = [ # tools @@ -70,7 +71,7 @@ class NetBSDVM(basevm.BaseVM): ipv6 = False def build_image(self, img): - cimg = self._download_with_cache(self.link) + cimg = self._download_with_cache(self.link, sha512sum=self.csum) img_tmp = img + ".tmp" iso = img + ".install.iso" From patchwork Tue Nov 12 14:50:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 179199 Delivered-To: patch@linaro.org Received: by 2002:ac9:3c86:0:0:0:0:0 with SMTP id w6csp7848654ocf; Tue, 12 Nov 2019 06:51:54 -0800 (PST) X-Google-Smtp-Source: APXvYqylyJ3YQfrkGv2WVLvKQY28d0S0c7Oa2zM6EVT7INEvscsqnkKeInL3PBeegcixD06qHjH5 X-Received: by 2002:aa7:cd52:: with SMTP id v18mr33268749edw.280.1573570314137; Tue, 12 Nov 2019 06:51:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573570314; cv=none; d=google.com; s=arc-20160816; b=f7d7ulWs4o7HIRqMt66gr24j560FnXWf21jAmX1R6y5dl2vc/TCb96+TNOSgANyERw LUmZGHiweW3VlXNK98/M57UMvWyNdek3wBV7/x4AGWXo9yVcZ7jNY1SIC2AOtn3sRsro WhWImlrriwB2CGfi6tz3HLWFy8hZak06uGBg2/wTg6iKqz4RixXQM9J/0bgKlOTYdTgl 1/8qoRN2rxkrE/zaIfabWv+VQ6k6GHWRMtCDABREmIMhhEmA1cr7jaZYJw9PB7JpFPOA BBN2UXMJc5TSbySCtx4iVXMaagEwz3eQe1eg2ThvL9GJAn6Fnhunjvv/FDro9QNRjsN0 kB3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=vY7V32XD/jc7g4KIqXW4kFH1SEbrWpPCQjXNemV53O0=; b=QdnmtydSg38IKoMa5a9BVlb78GpZIFiOaChunEx04B6aCGkrbI3X2HksSeVpyPkZ/D 0Q3qEuJ3jvuxUxNCtUZOkeqibcmBHmD39Rw4maEMn3LZI78YF77EgavEmoHds6uZHVey ZYe23HGWo3XNhi4X6plRgZ60OIMkHo3DtsPzAlcTOCjIarPpLcr2wk3UfN9Lqe0NhZhb 3KdH7SUQmgqHyXNyLNJb+NhNyZpQZtSlkelSEwVxhtiyhqX7SrOmfog+wiPRyQl90C5d dYRfKWZS4ur/OwhBxQaX8L54PNUGmBwdTsxsrRRN/XbUtm3rMotCjnGu1V+tcvzNUvaG oQJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=krw2ZxDy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p13si82617eju.398.2019.11.12.06.51.53 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Nov 2019 06:51:54 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=krw2ZxDy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUXWK-0004qI-Hf for patch@linaro.org; Tue, 12 Nov 2019 09:51:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59761) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUXVC-0003Wa-BY for qemu-devel@nongnu.org; Tue, 12 Nov 2019 09:50:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUXVB-00036l-Af for qemu-devel@nongnu.org; Tue, 12 Nov 2019 09:50:42 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:50408) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iUXVB-00036A-4M for qemu-devel@nongnu.org; Tue, 12 Nov 2019 09:50:41 -0500 Received: by mail-wm1-x32c.google.com with SMTP id l17so3523389wmh.0 for ; Tue, 12 Nov 2019 06:50:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vY7V32XD/jc7g4KIqXW4kFH1SEbrWpPCQjXNemV53O0=; b=krw2ZxDySkm3o9mNFrQqb7DUTW05rIj8SuopYbqsUmq+xzJZoiH2moT5v2ygMq+btH FhZoJr4CQN6hZFI+Euq1KUOTQK7OV0QpxrA1lnDfSq+RcZd1aYvJf20EY25Tpdd9E0C3 8pq4gwblHCtFQxZQ0WZ61s5iaFplAXJ0HH/bxPPxAc5AszScJWJDU5CZcHXW7ZdLurU+ tRuECfAgiMtbpMkoodPuInL/tgGasaSAFPRiCo9mX3UlAEjtyuAV+ypFifJ7tBReeCh5 2VfcMDa6TLxATw/scvbbqUfT018OLPzNFWxv3+2uoI/STwBFD6VrmPfRvzA2mAe0ob5I Wy5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vY7V32XD/jc7g4KIqXW4kFH1SEbrWpPCQjXNemV53O0=; b=N8Emk9LWRMVmODcm/Vv3wkbZ8jZh2LWwVGT5qw7fvwCrZNRvgislDcpEiI49dhATuI Xx00s7AUOGo3gaLPPEjn1tRwhViY/AuB3msxN1MARCyXSfVwb6b0WsZNXBbAYwScKHDp BgpCIzHeiwX0bvAjU9htUwaLD4IOrL9pPLmLwEwkovJ58j4nJ2TpsFjt92QgNLCngjQ4 p1O82kuroMtm8tZrJfqupCNDtp1ouxbQI2BnvYP3HsW9aQDWTHZBiGcGsPOF4ZNEXSay 5ButaL3rwKkvlK6FlvtQD5irwjXHxmun2dgsHoqF1lWPMhmECDUC+2a3cxfhZXYoHrKs dktg== X-Gm-Message-State: APjAAAUI5hnNSwr/b44GdEhNacOU2csPZaA2RHUz9UsF3hx1hgliTyBI oFziGT8m78TH7WynHFac/uKS7w== X-Received: by 2002:a1c:6588:: with SMTP id z130mr3888853wmb.87.1573570239990; Tue, 12 Nov 2019 06:50:39 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id x9sm19479424wru.32.2019.11.12.06.50.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2019 06:50:35 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A17C31FF96; Tue, 12 Nov 2019 14:50:29 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 7/8] .travis.yml: don't run make check with multiple jobs Date: Tue, 12 Nov 2019 14:50:27 +0000 Message-Id: <20191112145028.26386-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191112145028.26386-1-alex.bennee@linaro.org> References: <20191112145028.26386-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Let's challenge the convention that doing more at a time helps. It certainly doesn't tell you unambiguously where in the test cycle you were before the test hangs and exceeds the job time limit. Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/.travis.yml b/.travis.yml index 678e33decc2..b9a026c8eeb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -77,7 +77,7 @@ env: - SRC_DIR="." - BUILD_DIR="." - BASE_CONFIG="--disable-docs --disable-tools" - - TEST_CMD="make check -j3 V=1" + - TEST_CMD="make check V=1" # This is broadly a list of "mainline" softmmu targets which have support across the major distros - MAIN_SOFTMMU_TARGETS="aarch64-softmmu,arm-softmmu,i386-softmmu,mips-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu" - CCACHE_SLOPPINESS="include_file_ctime,include_file_mtime" From patchwork Tue Nov 12 14:50:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 179207 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp8230362ilf; Tue, 12 Nov 2019 07:00:04 -0800 (PST) X-Google-Smtp-Source: APXvYqz205vu4x4a+NwFwRm5Fgb4M/ydCgEMaff3TBoGalRf+RUVbE9YGg/dEIb7g5EHvT91wXw3 X-Received: by 2002:ae9:e404:: with SMTP id q4mr1144445qkc.365.1573570804324; Tue, 12 Nov 2019 07:00:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573570804; cv=none; d=google.com; s=arc-20160816; b=uSCDQa6GOX4Nl5RgDznG/Odi0qdIETcxpU8rE7ZxtPypmcEPewsVc2JtUaslCj+7/j CCquni+tMgjOrVbVC7HNrPUUEsrymSTRNZF+9AwzfLgNu9uTfOJZxIa147HGzx/b+8rW whdqezH5P+p5B44UM0tXAEfIkIoklnluB+voHH081Cm9yR+BmaFOE7d8wzQuwUL7sEnG iV9Nv1vtrxwOH3EzVX18b+sSND4PmETkcUcw7GrY1e9HcoriYaILu3aO1If6Ws93lQfy 5sBLwVP2sjmvk98HtZtPK2DqvseK9mDlmpHHRSI66KInAXNF+LZtPjPZssV5UgMgEKjV qLSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=gqg0+V7qSEz/6ZJOKa53BGZgGZ5jVCsKocXvLtTyKDM=; b=j4ZNgxr3n5Q5pdVSUErw0GP+MH/FyxakrelFEV/MtYB9O9vpV6irNZjM5E3oZDfshU x7sHmTkSnKTWS5eyoIPwk0H4Aj6KiHeGBfdfrNEPXlOhZLgD05DXYwpPEVt9Z8Fp5jWF 2fnnrvujL9DfcO/ySNrc1YQ9bWekP6Hq639jtXSksLe1oqTjm5B4Fp+WpbVqQOUq433D vV6ZguZAA9A96zwF9N7AZUJbjzt+wC72keCbrdt5ETv8cwtywt2FCSxrOcKPaDb1Cwg2 DmuRm7M9AfZg27SVQ/PBL6ibElRXf8P1SKTrHJMhKq0DfxBWKjA/qmb7VK2vyX2P7yr8 +btA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="cGi/Yk2C"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n135si5993982qka.216.2019.11.12.07.00.04 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Nov 2019 07:00:04 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="cGi/Yk2C"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36004 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUXeF-0004o5-Rr for patch@linaro.org; Tue, 12 Nov 2019 10:00:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59785) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUXVD-0003ZW-W8 for qemu-devel@nongnu.org; Tue, 12 Nov 2019 09:50:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUXVC-00037p-8J for qemu-devel@nongnu.org; Tue, 12 Nov 2019 09:50:43 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:39964) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iUXVC-00036t-1a for qemu-devel@nongnu.org; Tue, 12 Nov 2019 09:50:42 -0500 Received: by mail-wr1-x436.google.com with SMTP id i10so18836240wrs.7 for ; Tue, 12 Nov 2019 06:50:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gqg0+V7qSEz/6ZJOKa53BGZgGZ5jVCsKocXvLtTyKDM=; b=cGi/Yk2CehzucHabB93Ij5kZCzQJ+6MYYNgNxLnbbXlH1Xas/XnGWoNE1xyU4B47Yu jQF7Flaw8Fo+yemlkVPYqChTV3FQ2ESyGiYRSjhUoQX2TUJDJItAqzkbJij2i2KBn7Or V5XW8EGDij7u/M56tYBlsGkUNsx3XF7mzuGUkFWlme1Z8pMPwJVQIR6KWCGWbrWAbWmT 1jbx5pr3Y1m900INehVbJT+/cgakEEKyfyjhdKiK25kw7kY1cPGmzvyV5wLVlYNJzoDI A9TpjVMeEgUm6Xw7dI0btutPKNJGDsP/tiJN6wctHaXNC1QQ7Qx6yqVVct364PABxGTO AXxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gqg0+V7qSEz/6ZJOKa53BGZgGZ5jVCsKocXvLtTyKDM=; b=M7CfognzxmkuaSaaDXTUbJxabheJXP1csQ1WAmjfaC3qNtI18wbJc1EwRNygA3snGr XzI7xdgTKu1UkvSnMIIA1jP486CF/rh54OTs2FweNBPia4UTwkHGYXIyIoYTPz9UNxI9 u/3WgyoZQLpjh6ZemhvkX6E0X76KqMb0MhAq8MqIQGz14dyOzzeGYbZzxMc1KTEP0Tqo lVBP5NRFpt163fTmy9eL390sAedLmd0Fo34sktNAIjiUIQVIdP+jusPmbogJuGxVu+dl GyMXRehkdBkVIzVSWG/1WuQE7XgDun1mde1vaIFR5w3ky+aX9RyFKi+YArRPq6bVhgtK W0iQ== X-Gm-Message-State: APjAAAUQ5/nnqnSKqbNnplCH6oB6QieqUzLX1yjQpIKLLvQxbZkW80Bh HK+40PokclhHMXvsOYvaFEO3Aw== X-Received: by 2002:adf:979a:: with SMTP id s26mr21423502wrb.92.1573570240901; Tue, 12 Nov 2019 06:50:40 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id l4sm3185204wme.4.2019.11.12.06.50.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2019 06:50:35 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C31801FF98; Tue, 12 Nov 2019 14:50:29 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 8/8] tcg plugins: expose an API version concept Date: Tue, 12 Nov 2019 14:50:28 +0000 Message-Id: <20191112145028.26386-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191112145028.26386-1-alex.bennee@linaro.org> References: <20191112145028.26386-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::436 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Robert Foley Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is a very simple versioning API which allows the plugin infrastructure to check the API a plugin was built against. We also expose a min/cur API version to the plugin via the info block in case it wants to avoid using old deprecated APIs in the future. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Reviewed-by: Robert Foley -- 2.20.1 diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index a00a7deb461..5502e112c81 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -38,9 +38,28 @@ typedef uint64_t qemu_plugin_id_t; +/* + * Versioning plugins: + * + * The plugin API will pass a minimum and current API version that + * QEMU currently supports. The minimum API will be incremented if an + * API needs to be deprecated. + * + * The plugins export the API they were built against by exposing the + * symbol qemu_plugin_version which can be checked. + */ + +extern QEMU_PLUGIN_EXPORT int qemu_plugin_version; + +#define QEMU_PLUGIN_VERSION 0 + typedef struct { /* string describing architecture */ const char *target_name; + struct { + int min; + int cur; + } version; /* is this a full system emulation? */ bool system_emulation; union { diff --git a/plugins/loader.c b/plugins/loader.c index ce724ed5839..15fc7e55156 100644 --- a/plugins/loader.c +++ b/plugins/loader.c @@ -178,6 +178,25 @@ static int plugin_load(struct qemu_plugin_desc *desc, const qemu_info_t *info) goto err_symbol; } + if (!g_module_symbol(ctx->handle, "qemu_plugin_version", &sym)) { + error_report("TCG plugin %s does not declare API version %s", + desc->path, g_module_error()); + goto err_symbol; + } else { + int version = *(int *)sym; + if (version < QEMU_PLUGIN_MIN_VERSION) { + error_report("TCG plugin %s requires API version %d, but " + "this QEMU supports only a minimum version of %d", + desc->path, version, QEMU_PLUGIN_MIN_VERSION); + goto err_symbol; + } else if (version > QEMU_PLUGIN_VERSION) { + error_report("TCG plugin %s requires API version %d, but " + "this QEMU supports only up to version %d", + desc->path, version, QEMU_PLUGIN_VERSION); + goto err_symbol; + } + } + qemu_rec_mutex_lock(&plugin.lock); /* find an unused random id with &ctx as the seed */ @@ -248,6 +267,8 @@ int qemu_plugin_load_list(QemuPluginList *head) g_autofree qemu_info_t *info = g_new0(qemu_info_t, 1); info->target_name = TARGET_NAME; + info->version.min = QEMU_PLUGIN_MIN_VERSION; + info->version.cur = QEMU_PLUGIN_VERSION; #ifndef CONFIG_USER_ONLY MachineState *ms = MACHINE(qdev_get_machine()); info->system_emulation = true; diff --git a/plugins/plugin.h b/plugins/plugin.h index 5482168d797..1aa29dcaddf 100644 --- a/plugins/plugin.h +++ b/plugins/plugin.h @@ -14,6 +14,8 @@ #include +#define QEMU_PLUGIN_MIN_VERSION 0 + /* global state */ struct qemu_plugin_state { QTAILQ_HEAD(, qemu_plugin_ctx) ctxs; diff --git a/tests/plugin/bb.c b/tests/plugin/bb.c index 45e1de5bd68..f30bea08dcc 100644 --- a/tests/plugin/bb.c +++ b/tests/plugin/bb.c @@ -14,6 +14,8 @@ #include +QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION; + static uint64_t bb_count; static uint64_t insn_count; static bool do_inline; diff --git a/tests/plugin/empty.c b/tests/plugin/empty.c index 3f60f690278..8fa6bacd93d 100644 --- a/tests/plugin/empty.c +++ b/tests/plugin/empty.c @@ -13,6 +13,8 @@ #include +QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION; + /* * Empty TB translation callback. * This allows us to measure the overhead of injecting and then diff --git a/tests/plugin/hotblocks.c b/tests/plugin/hotblocks.c index 1bd183849a1..3942a2ca544 100644 --- a/tests/plugin/hotblocks.c +++ b/tests/plugin/hotblocks.c @@ -15,6 +15,8 @@ #include +QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION; + static bool do_inline; /* Plugins need to take care of their own locking */ diff --git a/tests/plugin/hotpages.c b/tests/plugin/hotpages.c index 77df07a3ccf..ecd6c187327 100644 --- a/tests/plugin/hotpages.c +++ b/tests/plugin/hotpages.c @@ -18,6 +18,8 @@ #include +QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION; + #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) static uint64_t page_size = 4096; diff --git a/tests/plugin/howvec.c b/tests/plugin/howvec.c index 58fa675e348..4ca555e1239 100644 --- a/tests/plugin/howvec.c +++ b/tests/plugin/howvec.c @@ -20,6 +20,8 @@ #include +QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION; + #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) typedef enum { diff --git a/tests/plugin/insn.c b/tests/plugin/insn.c index e5fd07fb64b..0a8f5a0000e 100644 --- a/tests/plugin/insn.c +++ b/tests/plugin/insn.c @@ -14,6 +14,8 @@ #include +QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION; + static uint64_t insn_count; static bool do_inline; diff --git a/tests/plugin/mem.c b/tests/plugin/mem.c index d9673889896..878abf09d19 100644 --- a/tests/plugin/mem.c +++ b/tests/plugin/mem.c @@ -14,6 +14,8 @@ #include +QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION; + static uint64_t mem_count; static uint64_t io_count; static bool do_inline;