From nobody Mon Sep 16 19:41:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1678135622; cv=none; d=zohomail.com; s=zohoarc; b=i1QyA5gVLhQatpMBnqNAOF/w/aqsQllIMmQxpEUISMM/TXLGO93cKpSYwkyNaWmqiR/q/LA4ZF29xM5EUz5G1SFwDaLGxDVB9lQhyfTr3mfbYHmYEQXpy+x2TdAM1zjlYAPtM3OFMhV3AyZFdqveEVTc1MRgsdn5QChKygkJK7o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678135622; 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=jhD/vUEh4pZ22JuLrNLFIW/sbG0k9LfNoV1HqJEHNHs=; b=mN/NvCotLL2za6ajuOr6U99DElcMd98Kxdw4NXhM8E9Uh5DtzYh6nEbflaz8nO3jKe4MeN3ta3nWwFHVfFE+YM9X9jxjvxvrZn/0maIy8xpERpxM+hmzUcW5OQs6dxlNAS8MIJu/EXOAPBKkX9hAvK7F+r9mzY6YmXMt9sbBnjI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1678135622057995.2365903344742; Mon, 6 Mar 2023 12:47:02 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-231-UJqkFfj4MOiiPyjGp016yQ-1; Mon, 06 Mar 2023 15:46:55 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3FDFD100F917; Mon, 6 Mar 2023 20:46:51 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 985A64035707; Mon, 6 Mar 2023 20:46:50 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8F2C819465B6; Mon, 6 Mar 2023 20:46:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BFF31194658F for ; Mon, 6 Mar 2023 20:46:48 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B0FDC440E0; Mon, 6 Mar 2023 20:46:48 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1106751FF for ; Mon, 6 Mar 2023 20:46:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678135621; 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=jhD/vUEh4pZ22JuLrNLFIW/sbG0k9LfNoV1HqJEHNHs=; b=b5wJaPExOmrauE2QBV381sneJCCGUoHY02/478mjiyA0CiGeYWIhwEvn/fSkNStP9OHBr8 ib5V8w4wJPEmU/t0Da/9t61qRtnLxJC9s7C9O3/E3qBp7fXF22VtNq7Jha3Ud4hj1B+h/M QeXLZUazlTCbScIYCE3xASJeUy9Ge4k= X-MC-Unique: UJqkFfj4MOiiPyjGp016yQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 01/15] qemu: validate: Fix logic for validating precence of the HPET timer Date: Mon, 6 Mar 2023 21:46:29 +0100 Message-Id: <4f9afb93d7b310fd88e59e9d2495079eabf9b0f3.1678135546.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1678135623055100006 Content-Type: text/plain; charset="utf-8" Commit 24cc9cda826 switched over to use -machine hpet, but one of the steps it did was to clear the QEMU_CAPS_NO_HPET capability. The validation check still uses the old capability though which means that for configs which would explicitly enable HPET we'd report an error. Since HPET is an x86(_64) platform specific device, convert the validation check to an architecture check as all supported qemu versions actually support it. Modify a test case to request HPET to catch posible future problems. Fixes: 24cc9cda826 Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_validate.c | 14 +++++++------- .../q35-virt-manager-basic.x86_64-4.2.0.args | 1 - .../q35-virt-manager-basic.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/q35-virt-manager-basic.xml | 2 +- .../q35-virt-manager-basic.x86_64-latest.xml | 2 +- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 30c11a567a..93077aadfc 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -599,13 +599,13 @@ qemuValidateDomainDefClockTimers(const virDomainDef *= def, break; case VIR_DOMAIN_TIMER_NAME_HPET: - /* no hpet timer available. The only possible action - is to raise an error if present=3D"yes" */ - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_NO_HPET) && - timer->present =3D=3D VIR_TRISTATE_BOOL_YES) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("hpet timer is not supported")); - return -1; + if (timer->present =3D=3D VIR_TRISTATE_BOOL_YES) { + if (def->os.arch !=3D VIR_ARCH_I686 && + def->os.arch !=3D VIR_ARCH_X86_64) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("hpet timer is not supported by this = architecture")); + return -1; + } } break; diff --git a/tests/qemuxml2argvdata/q35-virt-manager-basic.x86_64-4.2.0.arg= s b/tests/qemuxml2argvdata/q35-virt-manager-basic.x86_64-4.2.0.args index d8b840f171..b59f713101 100644 --- a/tests/qemuxml2argvdata/q35-virt-manager-basic.x86_64-4.2.0.args +++ b/tests/qemuxml2argvdata/q35-virt-manager-basic.x86_64-4.2.0.args @@ -23,7 +23,6 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-virt-ma= nager-basic/.config \ -mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ -rtc base=3Dutc,driftfix=3Dslew \ -global kvm-pit.lost_tick_policy=3Ddelay \ --no-hpet \ -no-shutdown \ -global ICH9-LPC.disable_s3=3D1 \ -global ICH9-LPC.disable_s4=3D1 \ diff --git a/tests/qemuxml2argvdata/q35-virt-manager-basic.x86_64-latest.ar= gs b/tests/qemuxml2argvdata/q35-virt-manager-basic.x86_64-latest.args index 4d029fd55f..5a7b5d7629 100644 --- a/tests/qemuxml2argvdata/q35-virt-manager-basic.x86_64-latest.args +++ b/tests/qemuxml2argvdata/q35-virt-manager-basic.x86_64-latest.args @@ -10,7 +10,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-virt-ma= nager-basic/.config \ -name guest=3Dvirt-manager-basic,debug-threads=3Don \ -S \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/va= r/lib/libvirt/qemu/domain--1-virt-manager-basic/master-key.aes"}' \ --machine q35,usb=3Doff,vmport=3Doff,dump-guest-core=3Doff,memory-backend= =3Dpc.ram,hpet=3Doff,acpi=3Don \ +-machine q35,usb=3Doff,vmport=3Doff,dump-guest-core=3Doff,memory-backend= =3Dpc.ram,hpet=3Don,acpi=3Don \ -accel kvm \ -cpu qemu64 \ -m 4096 \ diff --git a/tests/qemuxml2argvdata/q35-virt-manager-basic.xml b/tests/qemu= xml2argvdata/q35-virt-manager-basic.xml index c2d82c2c47..75075d0ab4 100644 --- a/tests/qemuxml2argvdata/q35-virt-manager-basic.xml +++ b/tests/qemuxml2argvdata/q35-virt-manager-basic.xml @@ -16,7 +16,7 @@ - + destroy restart diff --git a/tests/qemuxml2xmloutdata/q35-virt-manager-basic.x86_64-latest.= xml b/tests/qemuxml2xmloutdata/q35-virt-manager-basic.x86_64-latest.xml index 5bb00ceb38..08be45b5a5 100644 --- a/tests/qemuxml2xmloutdata/q35-virt-manager-basic.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/q35-virt-manager-basic.x86_64-latest.xml @@ -19,7 +19,7 @@ - + destroy restart --=20 2.39.2