From nobody Tue Nov 4 15:31:27 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1530200571837561.7306942195972; Thu, 28 Jun 2018 08:42:51 -0700 (PDT) Received: from localhost ([::1]:37201 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYZ4N-0007TY-25 for importer@patchew.org; Thu, 28 Jun 2018 11:42:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYYxz-0002Ov-QT for qemu-devel@nongnu.org; Thu, 28 Jun 2018 11:36:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYYxw-0001YC-Ng for qemu-devel@nongnu.org; Thu, 28 Jun 2018 11:36:15 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:33933) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fYYxw-0001Wy-Ht for qemu-devel@nongnu.org; Thu, 28 Jun 2018 11:36:12 -0400 Received: by mail-qt0-x243.google.com with SMTP id d23-v6so5116275qtp.1 for ; Thu, 28 Jun 2018 08:36:12 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id f36-v6sm4746179qtb.36.2018.06.28.08.36.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 08:36:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BdexD4LcKWMd1F/S3FptD3wSVVOG4j40AUjoyVxtuWg=; b=X4a/SJ0nXG+2aas0ynfIuA7T49Kyia/I/yw65wVEyNJrGUXSnm7niZD74XDHuItU9f z8U/FvAzMyrAWHh0GzSJ961/g6k+hSLRFfgqAckIz7fnNyOQh0lqrGwYC9KwxdzDp+hW kj8wMIGrb9r8I044K7yXEXzoJY0deJiPk8UZVAoY6uDClpVUL9RHV/jm7ZdGoFWqhFV/ C3/O8odwQX14zwsFMzWuX4Qxri1DpHUshU00WZckOBd96NZ6UvKA07G+wawFIYY4imbc YJ24Z+2xjb5Rjxy4x3Spg2QtFXDcwyY2njH81wWaTbaUk05E0cA4gnKJoNmRjWrpzq7p NfBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=BdexD4LcKWMd1F/S3FptD3wSVVOG4j40AUjoyVxtuWg=; b=U4g3rrjvywVqLdfeH5qVVQMC3b3jDTQNO5n6oJyyK4MmcWYRz4aU5lAiN2BGxoqdOs 40dDs1QK7kUy51NT6FFh2ac4qpLivyfrpxrj1m/WPcz8Zt/TqWV8JTimqYLPJzvJdBxc +5FqLKJviQcnqhvJZOW9cx8Mf16aVMA/jebVPMru9CIxhylHz+8+F3ZoyQGOLI9VWjTg aw5+aSnSRbh1rHwZrmqf35JS1pCtPuJ7NlDdugN2DYNjSc24OgojtNwli8XZ2/2G01L7 rvvuinUBg1jHZudGJjAKwiWMOESnsWMi/PfaHEVFf2nBJo84bBJBPvekTICYVsyKLrI+ j9XQ== X-Gm-Message-State: APt69E3Rw/DYsiQxZfq3/JZv2XpBWcw27HFyzq2OsBufZUV7n4uZIC4d YAulLhVKem5XssChS0CDa0k= X-Google-Smtp-Source: AAOMgpeU8aDjpN6XQ03iseTekg7fLggwHaF6jzZCwZlzascYawX/9qVQXx5xSV615kapumnwWTJLMg== X-Received: by 2002:aed:3607:: with SMTP id e7-v6mr9747691qtb.385.1530200171990; Thu, 28 Jun 2018 08:36:11 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Fam Zheng Date: Thu, 28 Jun 2018 12:35:34 -0300 Message-Id: <20180628153535.1411-4-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180628153535.1411-1-f4bug@amsat.org> References: <20180628153535.1411-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH 3/4] tests/vm: Only use -cpu 'host' if KVM is available X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 If KVM is not available, then use the 'max' cpu. This fixes: ERROR:root:Log: ERROR:root:qemu-system-x86_64: CPU model 'host' requires KVM Failed to prepare guest environment error: [Errno 104] Connection reset by peer source/qemu/tests/vm/Makefile.include:25: recipe for target 'tests/vm/ubu= ntu.i386.img' failed make: *** [tests/vm/ubuntu.i386.img] Error 2 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- tests/vm/basevm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 3643117816..d80cc8ab85 100755 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -65,7 +65,6 @@ class BaseVM(object): self._stdout =3D self._devnull self._args =3D [ \ "-nodefaults", "-m", "2G", - "-cpu", "host", "-netdev", "user,id=3Dvnet,hostfwd=3D:127.0.0.1:0-:22", "-device", "virtio-net-pci,netdev=3Dvnet", "-vnc", "127.0.0.1:0,to=3D20", @@ -73,9 +72,11 @@ class BaseVM(object): if vcpus: self._args +=3D ["-smp", str(vcpus)] if os.access("/dev/kvm", os.R_OK | os.W_OK): + self._args +=3D ["-cpu", "host"] self._args +=3D ["-enable-kvm"] else: logging.info("KVM not available, not using -enable-kvm") + self._args +=3D ["-cpu", "max"] self._data_args =3D [] =20 def _download_with_cache(self, url, sha256sum=3DNone): --=20 2.18.0