From nobody Mon May 6 01:35:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1596622968; cv=none; d=zohomail.com; s=zohoarc; b=QprpJuovghjJ2S+ADNTkhrwJUWVFVTuzw6bTG9WOkGJtrPlB9clWM+GIMJy6BAaS1WkxrIS8VWVG8+wlrvYXoU+tP8TCH0ahVaY/VfF+4wXaerGEx7Ty0mysqe+f1oBP9dSHow/omeof+4k4kgUcFcAbNNbpRkCt0q5L2iR9Cos= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596622968; h=Content-Type:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=y/d+FsJX6KZ53fKKmBwCeDJ49hhPAvGqglfCIApmhXw=; b=TRnXu0yQtzVpYjNiNX81aNuDY7zoBC6oOgTthrhHduk/CiKjnVE5hwJJnQhv4qAGC5EZZUbAJS7tgYTFSgLiKJRguGOtTjmQt//eBwfkbcgqgc5OCXEd6XIG7Xo5QkZgy9Ly9oZLYz2RldotDkqNADOPcRgy5aB3VhM8R38rDQc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1596622968724486.4068271611998; Wed, 5 Aug 2020 03:22:48 -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-250-ZfVPnVXXPoGfRM7VUUJSQA-1; Wed, 05 Aug 2020 06:22:45 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7756257; Wed, 5 Aug 2020 10:22:39 +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 3947B5C1BD; Wed, 5 Aug 2020 10:22:38 +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 3C47695A72; Wed, 5 Aug 2020 10:22:35 +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 075AMXic027218 for ; Wed, 5 Aug 2020 06:22:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id 067FD7193A; Wed, 5 Aug 2020 10:22:33 +0000 (UTC) Received: from thuth.com (ovpn-112-142.ams2.redhat.com [10.36.112.142]) by smtp.corp.redhat.com (Postfix) with ESMTP id A8DDA5F21A; Wed, 5 Aug 2020 10:22:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596622967; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:content-type:content-type:list-id: list-help:list-unsubscribe:list-subscribe:list-post; bh=y/d+FsJX6KZ53fKKmBwCeDJ49hhPAvGqglfCIApmhXw=; b=VHFWPrePM9Cvk1Sc5K1ZLR1++Oq0F1UdGRcF66rOnFu3Xo4m8L2Egj1/znXer9A7mdHA7o ZBvtXNLgYhqv3UMUCh9+sUlJyasBglBVcEptXY9MCjQgjoeU9yTUStgfT/ws3GuAFiJcLb tL9jgc0T6Cpvn8GM9u0rr1IgYzi3RPs= X-MC-Unique: ZfVPnVXXPoGfRM7VUUJSQA-1 From: Thomas Huth To: libvir-list@redhat.com Subject: [PATCH v2] qemu: Do not silently allow non-available timers on non-x86 systems Date: Wed, 5 Aug 2020 12:22:26 +0200 Message-Id: <20200805102226.18158-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Boris Fiuczynski , Peter Krempa 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.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" libvirt currently silently allows and some other timer tags in the guest XML definition for timers that do not exist on non-x86 systems. We should not silently ignore these tags since the users might not get what they expected otherwise. Note: The error is only generated if the timer is marked with present=3D"yes" - otherwise we would suddenly refuse XML definitions that worked without problems before. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=3D1754887 Signed-off-by: Thomas Huth Reviewed-by: Boris Fiuczynski Reviewed-by: Daniel Henrique Barboza Reviewed-by: Michal Privoznik --- v2: Check also for timer->present =3D=3D 1 src/qemu/qemu_validate.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 488f258d00..561e7b12c7 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -371,6 +371,18 @@ qemuValidateDomainDefClockTimers(const virDomainDef *d= ef, case VIR_DOMAIN_TIMER_NAME_TSC: case VIR_DOMAIN_TIMER_NAME_KVMCLOCK: case VIR_DOMAIN_TIMER_NAME_HYPERVCLOCK: + if (!ARCH_IS_X86(def->os.arch) && timer->present =3D=3D 1) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Configuring the '%s' timer is not suppor= ted " + "for virtType=3D%s arch=3D%s machine=3D%s= guests"), + virDomainTimerNameTypeToString(timer->name), + virDomainVirtTypeToString(def->virtType), + virArchToString(def->os.arch), + def->os.machine); + return -1; + } + break; + case VIR_DOMAIN_TIMER_NAME_LAST: break; =20 --=20 2.18.1