From nobody Wed May 8 14:54:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1631186734; cv=none; d=zohomail.com; s=zohoarc; b=ZUJvl4gJZRzO4zu5n6wRAMRgSbZMRwcfeH34s1lU3cVXm12Po+8JTd2zBvGSgXp8UbWufT1VlQ8nBm+U93c2MwGakAtcPcKrkHDC64ZLi6A/gt+JRFeTJJUCz2TtW/vj6z518bSdpHE4Mhfo+9/rRAWIKS2t08UmPmViEGOZG/M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631186734; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=r3kxgtNGue540/aSfzOB4yELKVpKPNhqAnflMKQ3FtQ=; b=AVd0HMAbUafxw46aTwNST7YwvKrpcp/8h6XUyzgcDEvQMxDeFDVPQYgfBPTbkj3Amtl/RRJ7dJzHeBV8BMvF6/tPGWd3FikCbMY/fdABN8ALHZitxNxlQKi/aIbiRDMaxtrHQ6WQotiJM3pUE1MXOV9jv7+w0dHpJPSrOHbOkeA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1631186734526888.3679001286505; Thu, 9 Sep 2021 04:25:34 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-127-CC2ObQgOMeqjMn7otbycow-1; Thu, 09 Sep 2021 07:25:31 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B003B1B18BC8; Thu, 9 Sep 2021 11:25:25 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8D7264180; Thu, 9 Sep 2021 11:25:25 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 34D561801241; Thu, 9 Sep 2021 11:25:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 189BPMO3013936 for ; Thu, 9 Sep 2021 07:25:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id E209D5D6CF; Thu, 9 Sep 2021 11:25:22 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.39.195.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 49EB66A8E4; Thu, 9 Sep 2021 11:25:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631186733; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=r3kxgtNGue540/aSfzOB4yELKVpKPNhqAnflMKQ3FtQ=; b=GReOeiriAcRxoyg6j7x+DyHMlBFMPHCxYk5/2RIxnfEpAbOX95TJUphVfMzUANaeIf+Dti FmkN/W74/5Oc7Y/mfev7dfXpoV1fv7nMTf0MgDnAI1sb3SQm+gv0DLFTr+7VkXALa9AUXm dAbbVFQjemryX0f1mSHzLDkZMGXRztQ= X-MC-Unique: CC2ObQgOMeqjMn7otbycow-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/4] qemu: prevent use of on non-x86 arches Date: Thu, 9 Sep 2021 12:25:13 +0100 Message-Id: <20210909112516.854126-2-berrange@redhat.com> In-Reply-To: <20210909112516.854126-1-berrange@redhat.com> References: <20210909112516.854126-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1631186735508100001 The config results in use of the '-device sga' QEMU options. This in turn causes QEMU go load the sgabios.bin option ROM, which contains x86 machine code. This cannot work on non-x86 arches, thus we should block the bad config. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: J=C3=A1n Tomko Reviewed-by: Richard W.M. Jones --- src/qemu/qemu_validate.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index d8f39b6bdd..3789361b57 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1194,6 +1194,14 @@ qemuValidateDomainDef(const virDomainDef *def, =20 /* Serial graphics adapter */ if (def->os.bios.useserial =3D=3D VIR_TRISTATE_BOOL_YES) { + /* -device sga is only sane on x86, since the option ROM it + * loads contains x86 machine code. + */ + if (!ARCH_IS_X86(def->os.arch)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("BIOS serial console only supported on x86 ar= chitectures")); + return -1; + } if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SGA)) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("qemu does not support SGA")); --=20 2.31.1 From nobody Wed May 8 14:54:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1631186742; cv=none; d=zohomail.com; s=zohoarc; b=Uo8ANaNUBr6luPkjC4BIDTQzB+kVMcyPQSQwt1RWugMBtg1aH2sOoZhgAj1heyn6eZqWeqnfuv+e2mkCdIay1eBzq/REmG9dmLghdgP56EQJmWs9zgvffOEEuAlt3wgOlNKgSqtoLH78TuoBrvEra4fBrvK01OnidVJka1fo8sw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631186742; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FTEfLD6ZiJoScFuAsRWIF29d69wz6oXk8k5jjMnpCl4=; b=RlODaimKQLGpyFdbMGS4ChBfdalOcLmzuPldG79z1uYyicfhPpPSLx/RmPUNBqQKfhXhEcpFDSPmf/soEsmr2u61LfsKCMuNgduF8guJUo7kYOVVfsDvJ0wRdE6mXQTx6ojBA4OM2WQ3wNaWPNkTbOmMGxnG9MstmZvPkv93Guk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1631186742779423.9185927238658; Thu, 9 Sep 2021 04:25:42 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-111-GPVOzvo2MoOU0AbqnG3Z2g-1; Thu, 09 Sep 2021 07:25:39 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A77D7835DEB; Thu, 9 Sep 2021 11:25:34 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 883AA5D9F4; Thu, 9 Sep 2021 11:25:34 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 589A51806D01; Thu, 9 Sep 2021 11:25:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 189BPNgs013951 for ; Thu, 9 Sep 2021 07:25:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id DD8ED1ABD8; Thu, 9 Sep 2021 11:25:23 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.39.195.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4533F5D6AD; Thu, 9 Sep 2021 11:25:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631186741; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=FTEfLD6ZiJoScFuAsRWIF29d69wz6oXk8k5jjMnpCl4=; b=df5BtBdW1YHKchz7G5pqTNJaA5cZLhlu+TeDVnWysPZ07tEozm/lnRoPHX4fkm0PNKzzgo H42fR0354Tq8Z5uryqLh1y30+HtEIAutPVmLZWu8OzGFGyG2EGFpUwyw5xnhr8UqxYVLDr 4ikS45lSQ9BST0LpoIRqpquKeH9d5T4= X-MC-Unique: GPVOzvo2MoOU0AbqnG3Z2g-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 2/4] qemu: tweak error message to be more general purpose Date: Thu, 9 Sep 2021 12:25:14 +0100 Message-Id: <20210909112516.854126-3-berrange@redhat.com> In-Reply-To: <20210909112516.854126-1-berrange@redhat.com> References: <20210909112516.854126-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1631186744436100001 The BIOS serial console output is currently implemented using the QEMU 'sga' device, but this is going to change in future patches, so the error message ought to be more generically phrased. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: J=C3=A1n Tomko Reviewed-by: Richard W.M. Jones --- src/qemu/qemu_validate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 3789361b57..47012748e8 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1209,7 +1209,7 @@ qemuValidateDomainDef(const virDomainDef *def, } if (!def->nserials) { virReportError(VIR_ERR_XML_ERROR, "%s", - _("need at least one serial port to use SGA")); + _("need at least one serial port to use BIOS se= rial output")); return -1; } } --=20 2.31.1 From nobody Wed May 8 14:54:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1631186736; cv=none; d=zohomail.com; s=zohoarc; b=gCWEO3/OLmQP1+bDsmwzVUm7W4RjjWct4R2H4oXJDv+ngSrcKDNOAa2KAdGJvLvu+lOcJQPYC95w+PRNPqe5Febj3sgJlf/XXEWBGz84ejYN3Nmni5NbJ4rOEqx7LxL3bGxFJ38A6LTcJ5+WAVu5WQGILePkeZ6FeOMs8AOjX/c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631186736; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=izxXtCZGxuSo3i1Hn+EBPC8zGUKbuuPs43ItmHVq1RE=; b=IYsS95cEWyJYcnA4SluvwKj+Z55NkiQTdGYROLfs7KVDXytORn2InFtTOvTiCTUenGIjQFWyVNLgOGuMpl1QjgrbTXr3yH4/1YWvWH/bV8+JXyFjqT5A2C4/jhFdH86t7HSTbpxd9uvhUs8jKnDrk+307ItGmQi9O9inIwtw2a4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1631186736569465.51943508236343; Thu, 9 Sep 2021 04:25:36 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-206-khdSzH_fNliQErOtKCaS9Q-1; Thu, 09 Sep 2021 07:25:33 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6BF62100C662; Thu, 9 Sep 2021 11:25:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 51BEC19C87; Thu, 9 Sep 2021 11:25:27 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 239694EA2A; Thu, 9 Sep 2021 11:25:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 189BPOMk013960 for ; Thu, 9 Sep 2021 07:25:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id DB3965D6CF; Thu, 9 Sep 2021 11:25:24 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.39.195.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3538C5D6AD; Thu, 9 Sep 2021 11:25:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631186735; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=izxXtCZGxuSo3i1Hn+EBPC8zGUKbuuPs43ItmHVq1RE=; b=XVk2LnZQouY75w8geDikGPTLevYQ/YVvCxesL6mZOm1gvuKlu65JLAwb0zQHjfyeirNPW4 YKXM/mQcKZzCip/2IwsJIIJppwwNmo9ld5Cq35HB30wYWBltmkYJcZHrXs8DfcLk6rJaUW 0xUbCf6LIFO84JMxAPyCif4e/5XJgNI= X-MC-Unique: khdSzH_fNliQErOtKCaS9Q-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 3/4] qemu: switch to use -M graphics=off instead of -device sga Date: Thu, 9 Sep 2021 12:25:15 +0100 Message-Id: <20210909112516.854126-4-berrange@redhat.com> In-Reply-To: <20210909112516.854126-1-berrange@redhat.com> References: <20210909112516.854126-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1631186737638100005 SeaBIOS >=3D 1.11 has built-in support for outputting to the serial console when QEMU sets -M graphics=3Doff. Our minimum QEMU version is 2.11.0, which bundled SeaBIOS 1.11. Thus we have no need to use '-device sga' anymore. This change results in a slight layout difference for option ROMs in memory, however, it does not affect the migration data stream format on the wire and once migration is complete the target QEMU memory layout for ROMs matches the source QEMU once again. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: J=C3=A1n Tomko Reviewed-by: Richard W.M. Jones --- src/qemu/qemu_command.c | 25 ++++++++++--------------- src/qemu/qemu_validate.c | 13 ++++++------- tests/qemuxml2argvdata/bios.args | 3 +-- tests/qemuxml2argvtest.c | 3 +-- 4 files changed, 18 insertions(+), 26 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index b230314f7f..4d29313f45 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5956,18 +5956,6 @@ qemuBuildVMGenIDCommandLine(virCommand *cmd, } =20 =20 -static int -qemuBuildSgaCommandLine(virCommand *cmd, - const virDomainDef *def) -{ - /* Serial graphics adapter */ - if (def->os.bios.useserial =3D=3D VIR_TRISTATE_BOOL_YES) - virCommandAddArgList(cmd, "-device", "sga", NULL); - - return 0; -} - - static char * qemuBuildClockArgStr(virDomainClockDef *def) { @@ -7054,6 +7042,16 @@ qemuBuildMachineCommandLine(virCommand *cmd, virBufferAsprintf(&buf, ",memory-backend=3D%s", defaultRAMid); } =20 + /* On x86 targets, graphics=3Doff activates the serial console + * output mode in the firmware. On non-x86 targets it has + * various other undesirable effects that we certainly do + * not want to have. We rely on the validation code to have + * blocked useserial=3Dyes on non-x86 + */ + if (def->os.bios.useserial =3D=3D VIR_TRISTATE_BOOL_YES) { + virBufferAddLit(&buf, ",graphics=3Doff"); + } + virCommandAddArgBuffer(cmd, &buf); =20 return 0; @@ -10553,9 +10551,6 @@ qemuBuildCommandLine(virQEMUDriver *driver, virCommandAddArg(cmd, "-no-user-config"); virCommandAddArg(cmd, "-nodefaults"); =20 - if (qemuBuildSgaCommandLine(cmd, def) < 0) - return NULL; - if (qemuBuildMonitorCommandLine(logManager, secManager, cmd, cfg, def,= priv) < 0) return NULL; =20 diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 47012748e8..9d93f373ab 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1194,19 +1194,18 @@ qemuValidateDomainDef(const virDomainDef *def, =20 /* Serial graphics adapter */ if (def->os.bios.useserial =3D=3D VIR_TRISTATE_BOOL_YES) { - /* -device sga is only sane on x86, since the option ROM it - * loads contains x86 machine code. + /* On x86 -machine graphics=3Doff toggles the use of the + * serial console in SeaBIOS (and theoretically other + * firmwares). + * On non-x86, it has also sorts of other effects + * on QEMU device models created and so we don't + * want to allow its use. */ if (!ARCH_IS_X86(def->os.arch)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("BIOS serial console only supported on x86 ar= chitectures")); return -1; } - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SGA)) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("qemu does not support SGA")); - return -1; - } if (!def->nserials) { virReportError(VIR_ERR_XML_ERROR, "%s", _("need at least one serial port to use BIOS se= rial output")); diff --git a/tests/qemuxml2argvdata/bios.args b/tests/qemuxml2argvdata/bios= .args index 7356d1626d..7d831a716d 100644 --- a/tests/qemuxml2argvdata/bios.args +++ b/tests/qemuxml2argvdata/bios.args @@ -10,7 +10,7 @@ QEMU_AUDIO_DRV=3Dnone \ /usr/bin/qemu-system-i386 \ -name guest=3Dtest-bios,debug-threads=3Don \ -S \ --machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff,graphics=3Doff \ -bios /usr/share/seabios/bios.bin \ -m 1024 \ -realtime mlock=3Doff \ @@ -19,7 +19,6 @@ QEMU_AUDIO_DRV=3Dnone \ -display none \ -no-user-config \ -nodefaults \ --device sga \ -chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-test-bios/monit= or.sock,server=3Don,wait=3Doff \ -mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ -rtc base=3Dutc \ diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index c67214d01e..4d82267598 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1192,8 +1192,7 @@ mymain(void) DO_TEST_PARSE_ERROR_NOCAPS("reboot-timeout-enabled"); =20 DO_TEST("bios", - QEMU_CAPS_DEVICE_ISA_SERIAL, - QEMU_CAPS_SGA); + QEMU_CAPS_DEVICE_ISA_SERIAL); DO_TEST_NOCAPS("bios-nvram"); DO_TEST("bios-nvram-secure", QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, --=20 2.31.1 From nobody Wed May 8 14:54:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1631186742; cv=none; d=zohomail.com; s=zohoarc; b=luE315Le7iCvW2BWywWBDOVnPwONJy1p8lmD3mj4C/zbB5onyus9wPL4Tvz3ypJbQcW1EJPOiWdMDIs0zRxn3OO/lkZaBGJGZdxcfHzKwwFIixDr42kuA1ZViInkxBNMDGdaPT/c/P4S330a+PRQcNU7sW3ErP0qBsWC7Os38EU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631186742; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=N21RPDkLBjMPWEJaxmB0CQWECQ3hbt9rIg9ZK+PDpHM=; b=WBp090gGaFQCZnVNFsWK1Obqqo5oNAu1+WocaWkI6FmrX51pbn2/Yoy8laI0mrpuwatQ7WTRwrzUGizCNRzEtorU2JguSwbGdxD1z6q1/YrTvKLVBmGBcZzfDIbWWjN/aGNHpuHvtDZo13cxue6PQw44Wy02aTO0FaMubLj3tEI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 163118674243740.33526702914173; Thu, 9 Sep 2021 04:25:42 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-99-ec_mpN1DOmS9kEtOipua2Q-1; Thu, 09 Sep 2021 07:25:39 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AC168802C80; Thu, 9 Sep 2021 11:25:34 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8D8EE5D9C6; Thu, 9 Sep 2021 11:25:34 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 5D15D4EA37; Thu, 9 Sep 2021 11:25:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 189BPP1S013969 for ; Thu, 9 Sep 2021 07:25:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id D515B1ABD8; Thu, 9 Sep 2021 11:25:25 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.39.195.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 36F135D6AD; Thu, 9 Sep 2021 11:25:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631186741; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=N21RPDkLBjMPWEJaxmB0CQWECQ3hbt9rIg9ZK+PDpHM=; b=fb7wAWVzcjBgYFDnJ7GSQiY36LrfGopQT3wl82LmP3ULZb+7z+A2UTsfGn8ieYsabeCmI0 CE5B4RSbhNCMnBjpRNZ9sXesuEvm8mp8upVYaOgkFW2aoPoArDPl5UNK7lIoo0fqDWBqXX XAhau+ZtvWrqJh5q6KdrBE6O2Yg6LAs= X-MC-Unique: ec_mpN1DOmS9kEtOipua2Q-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 4/4] qemu: stop probing for '-device sga' support Date: Thu, 9 Sep 2021 12:25:16 +0100 Message-Id: <20210909112516.854126-5-berrange@redhat.com> In-Reply-To: <20210909112516.854126-1-berrange@redhat.com> References: <20210909112516.854126-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1631186744444100002 Since we no longer use '-device sga' we can stop probing for this device in our capabilities code. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: J=C3=A1n Tomko Reviewed-by: Richard W.M. Jones --- src/qemu/qemu_capabilities.c | 3 +-- src/qemu/qemu_capabilities.h | 2 +- tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml | 1 - 14 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 70c3ec2f0c..f27a621f8c 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -151,7 +151,7 @@ VIR_ENUM_IMPL(virQEMUCaps, "virtio-blk-pci.ioeventfd", /* QEMU_CAPS_VIRTIO_IOEVENTFD */ =20 /* 60 */ - "sga", /* QEMU_CAPS_SGA */ + "sga", /* X_QEMU_CAPS_SGA */ "virtio-blk-pci.event_idx", /* QEMU_CAPS_VIRTIO_BLK_EVENT_ID= X */ "virtio-net-pci.event_idx", /* QEMU_CAPS_VIRTIO_NET_EVENT_ID= X */ "cache-directsync", /* X_QEMU_CAPS_DRIVE_CACHE_DIRECTSYNC */ @@ -1219,7 +1219,6 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[= ] =3D { { "virtio-scsi-device", QEMU_CAPS_VIRTIO_SCSI }, { "megasas", QEMU_CAPS_SCSI_MEGASAS }, { "qxl", QEMU_CAPS_DEVICE_QXL }, - { "sga", QEMU_CAPS_SGA }, { "scsi-block", QEMU_CAPS_SCSI_BLOCK }, { "VGA", QEMU_CAPS_DEVICE_VGA }, { "cirrus-vga", QEMU_CAPS_DEVICE_CIRRUS_VGA }, diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index bc762d1916..f3379f556c 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -130,7 +130,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ QEMU_CAPS_VIRTIO_IOEVENTFD, /* virtio-{net|blk}-pci.ioeventfd=3Don */ =20 /* 60 */ - QEMU_CAPS_SGA, /* Serial Graphics Adapter */ + X_QEMU_CAPS_SGA, /* Serial Graphics Adapter */ QEMU_CAPS_VIRTIO_BLK_EVENT_IDX, /* virtio-blk-pci.event_idx */ QEMU_CAPS_VIRTIO_NET_EVENT_IDX, /* virtio-net-pci.event_idx */ X_QEMU_CAPS_DRIVE_CACHE_DIRECTSYNC, /* Is cache=3Ddirectsync supported= ? */ diff --git a/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml b/tests/qemu= capabilitiesdata/caps_2.11.0.x86_64.xml index 8a3c9c53c6..631f644144 100644 --- a/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml @@ -12,7 +12,6 @@ - diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml b/tests/qemu= capabilitiesdata/caps_2.12.0.x86_64.xml index 3cc5c86e4d..d74dc5ebd5 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml @@ -12,7 +12,6 @@ - diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_3.0.0.x86_64.xml index ff9f88d873..2cc3c11820 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml @@ -12,7 +12,6 @@ - diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_3.1.0.x86_64.xml index a80d381b71..bcc4c44d28 100644 --- a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml @@ -12,7 +12,6 @@ - diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_4.0.0.x86_64.xml index 19b8a49394..e999d7574c 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml @@ -12,7 +12,6 @@ - diff --git a/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_4.1.0.x86_64.xml index 841b753518..80c3e3cbed 100644 --- a/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml @@ -12,7 +12,6 @@ - diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_4.2.0.x86_64.xml index 6e3aa7f5d9..99f9375c04 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml @@ -12,7 +12,6 @@ - diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_5.0.0.x86_64.xml index 0c28645f69..03fc7d4106 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml @@ -12,7 +12,6 @@ - diff --git a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_5.1.0.x86_64.xml index fd77d9bbc9..fc0b502ef9 100644 --- a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml @@ -12,7 +12,6 @@ - diff --git a/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_5.2.0.x86_64.xml index 234ac8f7ef..cb1226fc04 100644 --- a/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml @@ -12,7 +12,6 @@ - diff --git a/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_6.0.0.x86_64.xml index 4951644354..d03b8aa726 100644 --- a/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml @@ -12,7 +12,6 @@ - diff --git a/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_6.1.0.x86_64.xml index eca9facf80..8239f4266a 100644 --- a/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml @@ -12,7 +12,6 @@ - --=20 2.31.1