From nobody Sun Feb 8 01:30:05 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) client-ip=63.128.21.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1584654296; cv=none; d=zohomail.com; s=zohoarc; b=dn8niLrBTDXTpBFQYeDN6cmM4EdanAkWaeFnlqAJjKpnteny/2Hm3DUWu/W29duXlWHuDrC1IzbSpwbfsZjFrBVStxOpyWWdEVtvWfGPO8xN6VdPhGmfIjTQBnYJSt6tls1mKZeLo8lbXAdmnnI8CaXT2cwhTuKD1qtrmwqKDuc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584654296; h=Content-Type:Content-Transfer-Encoding:Cc: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=L4NW+OblgLkXP8eZSy2spnC1P6cfYVZkyM6UkeXh0oQ=; b=D0iiCT8sruhgHHSSRERxwENnjAf+3oJHLJLdyAGPI3lYnx0VqNlEivQ3o1hHYED/r4wmBmjxEMwaGtMjK2F7mk0e09QnhA3zvxnj/Fq1lQa/8qDjPtAgRFgERBTYd8hKONRPOGeKPiZ9H4zLS/ugPrSxTmqJAt6CJog9D5ikeW0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [63.128.21.74]) by mx.zohomail.com with SMTPS id 1584654296027810.2805549380611; Thu, 19 Mar 2020 14:44:56 -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-454-9vGhmf-nNqKwGwc_2f4VSg-1; Thu, 19 Mar 2020 17:44:51 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A383D8010D9; Thu, 19 Mar 2020 21:44:45 +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 7A9EA19C58; Thu, 19 Mar 2020 21:44:45 +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 32FF894293; Thu, 19 Mar 2020 21:44:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 02JLiVNS024920 for ; Thu, 19 Mar 2020 17:44:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id 247612093CC5; Thu, 19 Mar 2020 21:44:31 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 20A192028DCC for ; Thu, 19 Mar 2020 21:44:27 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2C50B8007A4 for ; Thu, 19 Mar 2020 21:44:27 +0000 (UTC) Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-112-Z4gSoDBqNmCV99NxGibuSw-1; Thu, 19 Mar 2020 17:44:24 -0400 Received: by mail-qk1-f170.google.com with SMTP id d11so4896023qko.3 for ; Thu, 19 Mar 2020 14:44:24 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:a54:94b:6faa:a6b0:6b1b]) by smtp.gmail.com with ESMTPSA id c12sm2316347qkg.30.2020.03.19.14.44.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Mar 2020 14:44:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584654293; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=L4NW+OblgLkXP8eZSy2spnC1P6cfYVZkyM6UkeXh0oQ=; b=KoepHyof8YXMarrqHhvwaz+1Ygdet9C71jmfShvt8hl+XT0GfCEKUBXl8ZHYv295NSYjFH oSGxi3LpeemGfEy7cLBH0U68zNMO3O+woGqs/4dRqHp+BQJmgkGyQNQhGm4YYST6FQ0x7+ xwn+Gooeay3Ppaa4lDHIwUqwj4K4ROw= X-MC-Unique: 9vGhmf-nNqKwGwc_2f4VSg-1 X-MC-Unique: Z4gSoDBqNmCV99NxGibuSw-1 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=4YLnmj0TouOvET00c7pofAubmN0oM03Ah2iQapaQS1s=; b=sQrP8glcxBJxo3gxhu8aOObtRCYqtF5N3ETGSiDAS0fbZ+wy9ZAZ49LpSwg0fdQgtd WV9/w6Mh6laRtBDk4kqF4l803mjdLhr+ARnUYCDMU6h2ACsE1KfqA3rOnsG7mVNNi40Y sXbBmqu+qOEXjcPsFcv1jXM8gXMoYlBX8RqRo2JqRlRMYCuSpZZv/+J3qY49Y35htMZI HvFuXuOuSFCTGyMIqpfqoZyquUCCgop3HZBdle+tlqEYndPmoQeaNd7z5aFPOSZhefM+ zApfPlubDBnAT1+isAIxNoe3kWoYiPjBI2wVIRJVVUzhiVCcH4IW+e4nOq18vwog/Ukw JexQ== X-Gm-Message-State: ANhLgQ2xPuxT8DwwzNOl3LV6sWR6eEDePELxdGusyKJfo5fh8VDs7WGN pVPAdKV4l98IbvTLane6P/GPQIvn X-Google-Smtp-Source: ADFU+vtt0eGOtbPPCqbrdx54mV6VxmWn+QBC80TTZefsFUn9cxp0wZ8T7HfX9MaJRglDYVLLSMXhTA== X-Received: by 2002:a37:4f93:: with SMTP id d141mr5027363qkb.125.1584654264151; Thu, 19 Mar 2020 14:44:24 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v1 4/4] qemu_domain.c: do not launch ppc64 guests with Hyperv settings Date: Thu, 19 Mar 2020 18:44:07 -0300 Message-Id: <20200319214407.714006-5-danielhb413@gmail.com> In-Reply-To: <20200319214407.714006-1-danielhb413@gmail.com> References: <20200319214407.714006-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 02JLiVNS024920 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza 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.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Hyperv features aren't supported in QEMU for ppc64. The declaration in the XML by itself is benign, but any of its 14 current features will break QEMU with an error like this: qemu-kvm: Expected key=3Dvalue format, found hv_relaxed This is a more extreme case than the one for apic eoi because we would need an extra 'switch' statement, with all current Hyperv features in the body of qemuDomainDefValidateFeatures(), to check if the user attempted to activate any of them. It's easier to simply fail to launch with any 'hyperv' declaration in the XML for ppc64 guests. A fair disclaimer about Windows and PowerPC: the last Windows version that ran in the architecture is the hall of famer Windows NT 4.0, launched in 1996 and with end of extended support for the Server version in 2004 [1]. I am acknowledging that there might be Windows NT 4.0 users running in PowerPC, but not enough people running it under KVM/QEMU to justify Libvirt allowing 'hyperv' to exist in the domain XML of ppc64 domains. [1] https://en.wikipedia.org/wiki/Windows_NT_4.0 Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_domain.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 2e5f987a04..ba458bfde9 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5295,12 +5295,23 @@ qemuDomainDefValidateFeatures(const virDomainDef *d= ef, } break; =20 + case VIR_DOMAIN_FEATURE_HYPERV: + if (def->features[i] !=3D VIR_TRISTATE_SWITCH_ABSENT && + ARCH_IS_PPC64(def->os.arch)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Hyperv features are not supported for " + "architecture '%s' or machine type '%s'"), + virArchToString(def->os.arch), + def->os.machine); + return -1; + } + break; + case VIR_DOMAIN_FEATURE_ACPI: case VIR_DOMAIN_FEATURE_PAE: case VIR_DOMAIN_FEATURE_HAP: case VIR_DOMAIN_FEATURE_VIRIDIAN: case VIR_DOMAIN_FEATURE_PRIVNET: - case VIR_DOMAIN_FEATURE_HYPERV: case VIR_DOMAIN_FEATURE_CAPABILITIES: case VIR_DOMAIN_FEATURE_MSRS: case VIR_DOMAIN_FEATURE_LAST: --=20 2.25.1