From nobody Mon Feb 9 19:52:13 2026 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=1674485954; cv=none; d=zohomail.com; s=zohoarc; b=C6Dy0LoXh8iGuIBOYmkbwecsSBM+//3k7YTnY3a6uPYL4uYP4CmCajFLmzXmoo0sDpw+mD/K/3EvzZ/bqP3CWFeg2wjiZlgRE9h9bpJwtjvN0nmLGieZjqEN7a/wz7p+KVRUVO8kudpbkVVDBHsAdOESMIGsyxyKZcov8qZ7l/s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674485954; 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=iflAPhnj+9GrY213Co2cZAFiimZsYh0qk60xXllR76g=; b=SuaRIW7mj82YNYHM9hrnYZlyrl0g2MLRFukaOtP8NpO25qf1MMDh8u8g0jTGgf30H6lczJIn9BkGAKzzt8fQqJIYBvY8wY9T9MqB3+XfuMr1HlUHTAUI2sBkM18h7Rc6Gmn06ID7p2HcvPm7zG/dlbw4DGblVSnqrV6HvZUJxfQ= 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 1674485954123306.98985958813296; Mon, 23 Jan 2023 06:59:14 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-518-oNAJtxb2M9-JnofG12JfQg-1; Mon, 23 Jan 2023 09:58:14 -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 AC0CE3813F2B; Mon, 23 Jan 2023 14:58:11 +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 8FDC240C2004; Mon, 23 Jan 2023 14:58:11 +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 7EE59194658C; Mon, 23 Jan 2023 14:58:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BD1A11946589 for ; Mon, 23 Jan 2023 14:58:09 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id AD50A2026D2A; Mon, 23 Jan 2023 14:58:09 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A4BD02026D2B for ; Mon, 23 Jan 2023 14:58:09 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7D6423C31DED for ; Mon, 23 Jan 2023 14:58:09 +0000 (UTC) Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-190-g8zz7PKRMCOrDCipuLkXIA-1; Mon, 23 Jan 2023 09:58:02 -0500 Received: by mail-ed1-f69.google.com with SMTP id b15-20020a056402350f00b0049e42713e2bso8572201edd.0 for ; Mon, 23 Jan 2023 06:58:02 -0800 (PST) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id ks1-20020a170906f84100b00877696c016csm7517496ejb.146.2023.01.23.06.57.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 06:57:59 -0800 (PST) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id B7A23D1AD9C2 for ; Mon, 23 Jan 2023 15:57:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674485953; 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=iflAPhnj+9GrY213Co2cZAFiimZsYh0qk60xXllR76g=; b=YYE2jIxPX9QegALPqQ+eCbzv8sn5IxQxQJ2q3qvenvPuiqSe3GbHw4yBAe1grorRPy7M3B DQqOxuPps9AGq+J9u3tH5F/7KQvOnjhtxb3sbr2gsLnGJKhV6Cz28KyvmAG9HrkWaneJ87 ujZzN2vcGjx89B2tzPZb1YfE53vtdnM= X-MC-Unique: oNAJtxb2M9-JnofG12JfQg-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: g8zz7PKRMCOrDCipuLkXIA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iflAPhnj+9GrY213Co2cZAFiimZsYh0qk60xXllR76g=; b=4eifwmz1Sg+jM5JJJd75EMniAP6ReeolfA1lt6BiMzSaBYCNDDn7oRJbjAn2HQPIJ7 031E97rPc75GidZa0fh4Kp9wj6jpPSUmI0RmhlEUZpTJHCYY54wBcMkZFbxR2WQDeS1T nzST4oIr+oDkhXeCRi2VEQ29ERV4hfahIwsfyWdEP50F+4oGe1l/gF6WOnwdthUAnuJ4 UfucZThfIM1UKcKgw+SRtvPl4Gc81mwTO6tQR01HLrMVuVRX5KlrVEKMtz+l+Xge2iDo H1YwxUaqO/bulp5PXgwO+pR3k+Dsjm0+aCz/9sg6gw/BnhOE3KaB076H6jE+61bs81yH 3low== X-Gm-Message-State: AFqh2koQ3mWmjKlpO9m7DPPOw5vlkASzZS+04tBxdzCl2pBUWXnNlVpb OWcBY12rlakhIXABmBkOjmDWqj37E5VgtPbLAcc7PIHHTqRD7sPsMrnWRT63wrw4cpesaDp5GM8 tl9sD1uhs4cqVr7gJL7rqgwDE3gg7E38dNoxzuPgd16tqQwav9WkAcMQRtLD7ux0381t2vPA= X-Received: by 2002:a17:906:cd1f:b0:84d:4a2b:73b9 with SMTP id oz31-20020a170906cd1f00b0084d4a2b73b9mr26691704ejb.59.1674485881310; Mon, 23 Jan 2023 06:58:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXvxCjGWYo3EcuWpxr90qkWMtr7p+K8s+slOLunekIXjGRJtdgOGmR8g3ejq5Gkbqiern/WmJA== X-Received: by 2002:a17:906:cd1f:b0:84d:4a2b:73b9 with SMTP id oz31-20020a170906cd1f00b0084d4a2b73b9mr26691652ejb.59.1674485880312; Mon, 23 Jan 2023 06:58:00 -0800 (PST) From: Martin Kletzander To: libvir-list@redhat.com Subject: [PATCH 5/7] qemu: Add implicit watchdog for q35 machine types Date: Mon, 23 Jan 2023 15:57:54 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 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: 1674485954846100001 Content-Type: text/plain; charset="utf-8"; x-default="true" The iTCO watchdog is part of the q35 machine type since its inception, we j= ust did not add it implicitly. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2137346 Signed-off-by: Martin Kletzander --- src/qemu/qemu_domain.c | 44 +++++++++++++++++++ .../qemustatusxml2xmldata/vcpus-multi-in.xml | 1 + tests/qemuxml2argvdata/autoindex.args | 2 + .../boot-floppy-q35.x86_64-latest.args | 2 + tests/qemuxml2argvdata/boot-floppy-q35.xml | 1 + tests/qemuxml2argvdata/cpu-host-model.args | 2 + .../cpu-host-model.x86_64-4.2.0.args | 2 + .../cpu-host-model.x86_64-5.0.0.args | 2 + .../cpu-host-model.x86_64-5.1.0.args | 2 + .../cpu-host-model.x86_64-5.2.0.args | 2 + .../cpu-host-model.x86_64-6.0.0.args | 2 + .../cpu-host-model.x86_64-6.1.0.args | 2 + .../cpu-host-model.x86_64-latest.args | 2 + .../disk-floppy-q35.x86_64-latest.args | 2 + ...are-auto-bios-stateless.x86_64-latest.args | 2 + .../firmware-auto-bios.x86_64-latest.args | 2 + ...-auto-efi-enrolled-keys.x86_64-latest.args | 2 + ...-auto-efi-loader-secure.x86_64-latest.args | 2 + ...to-efi-no-enrolled-keys.x86_64-latest.args | 2 + ...are-auto-efi-no-secboot.x86_64-latest.args | 2 + ...firmware-auto-efi-nvram.x86_64-latest.args | 2 + ...rmware-auto-efi-secboot.x86_64-latest.args | 2 + ...ware-auto-efi-stateless.x86_64-latest.args | 2 + .../firmware-auto-efi.x86_64-latest.args | 2 + .../firmware-manual-efi-acpi-q35.args | 2 + .../firmware-manual-efi-secure.args | 2 + .../firmware-manual-noefi-acpi-q35.args | 2 + .../firmware-manual-noefi-noacpi-q35.args | 2 + ...dev-scsi-vhost-scsi-pcie.x86_64-4.2.0.args | 2 + ...ev-scsi-vhost-scsi-pcie.x86_64-latest.args | 2 + .../hvf-x86_64-q35-headless.args | 2 + .../intel-iommu-aw-bits.x86_64-latest.args | 2 + .../qemuxml2argvdata/intel-iommu-aw-bits.xml | 1 + ...ntel-iommu-caching-mode.x86_64-latest.args | 2 + .../intel-iommu-caching-mode.xml | 1 + ...ntel-iommu-device-iotlb.x86_64-latest.args | 2 + .../intel-iommu-device-iotlb.xml | 1 + .../intel-iommu-eim.x86_64-latest.args | 2 + tests/qemuxml2argvdata/intel-iommu-eim.xml | 1 + .../intel-iommu.x86_64-latest.args | 2 + tests/qemuxml2argvdata/intel-iommu.xml | 1 + ...othreads-ids-pool-sizes.x86_64-latest.args | 2 + .../iothreads-ids-pool-sizes.xml | 1 + .../machine-smm-off.x86_64-latest.args | 2 + .../machine-smm-on.x86_64-latest.args | 2 + tests/qemuxml2argvdata/pcie-expander-bus.args | 2 + .../pcie-root-port-model-generic.args | 2 + .../pcie-root-port-model-ioh3420.args | 2 + ...cie-root-port-nohotplug.x86_64-latest.args | 2 + tests/qemuxml2argvdata/pcie-root-port.args | 2 + tests/qemuxml2argvdata/pcie-root.args | 2 + .../pcie-switch-downstream-port.args | 2 + .../pcie-switch-upstream-port.args | 2 + tests/qemuxml2argvdata/pcihole64-q35.args | 2 + ...q35-default-devices-only.x86_64-4.2.0.args | 2 + ...35-default-devices-only.x86_64-latest.args | 2 + .../q35-multifunction.x86_64-4.2.0.args | 2 + .../q35-multifunction.x86_64-latest.args | 2 + .../q35-pci-force-address.args | 2 + .../q35-pcie-autoadd.x86_64-4.2.0.args | 2 + .../q35-pcie-autoadd.x86_64-latest.args | 2 + .../q35-pcie.x86_64-4.2.0.args | 2 + .../q35-pcie.x86_64-latest.args | 2 + .../q35-pm-disable-fallback.args | 2 + tests/qemuxml2argvdata/q35-pm-disable.args | 2 + tests/qemuxml2argvdata/q35-usb2-multi.args | 2 + tests/qemuxml2argvdata/q35-usb2-reorder.args | 2 + tests/qemuxml2argvdata/q35-usb2.args | 2 + .../q35-virt-manager-basic.x86_64-4.2.0.args | 2 + .../q35-virt-manager-basic.x86_64-latest.args | 2 + tests/qemuxml2argvdata/q35.args | 2 + .../sgx-epc.x86_64-7.0.0.args | 2 + tests/qemuxml2argvdata/sgx-epc.xml | 1 + .../tseg-explicit-size.x86_64-latest.args | 2 + .../usb-controller-default-q35.args | 2 + .../usb-controller-explicit-q35.args | 2 + .../user-aliases2.x86_64-latest.args | 2 + .../vcpu-placement-static.args | 2 + .../vcpu-placement-static.xml | 1 + ...vhost-user-fs-hugepages.x86_64-latest.args | 2 + .../vhost-user-fs-hugepages.xml | 1 + .../virtio-iommu-x86_64.x86_64-latest.args | 2 + ...virtio-non-transitional.x86_64-latest.args | 2 + .../virtio-transitional.x86_64-latest.args | 2 + .../watchdog-q35-multiple.x86_64-latest.args | 1 + ...default-cpu-kvm-q35-4.2.x86_64-latest.args | 2 + ...efault-cpu-tcg-features.x86_64-latest.args | 2 + .../x86_64-default-cpu-tcg-features.xml | 1 + ...default-cpu-tcg-q35-4.2.x86_64-latest.args | 2 + .../x86_64-q35-graphics.x86_64-latest.args | 2 + .../x86_64-q35-headless.x86_64-latest.args | 2 + tests/qemuxml2xmloutdata/autoindex.xml | 1 + ...ware-auto-bios-stateless.x86_64-latest.xml | 1 + .../firmware-auto-bios.x86_64-latest.xml | 1 + ...e-auto-efi-enrolled-keys.x86_64-latest.xml | 1 + ...e-auto-efi-loader-secure.x86_64-latest.xml | 1 + ...uto-efi-no-enrolled-keys.x86_64-latest.xml | 1 + ...ware-auto-efi-no-secboot.x86_64-latest.xml | 1 + .../firmware-auto-efi-nvram.x86_64-latest.xml | 1 + ...irmware-auto-efi-secboot.x86_64-latest.xml | 1 + .../firmware-auto-efi.x86_64-latest.xml | 1 + ...dev-scsi-vhost-scsi-pcie.x86_64-latest.xml | 1 + .../hvf-x86_64-q35-headless.xml | 1 + .../machine-smm-off.x86_64-latest.xml | 1 + .../machine-smm-on.x86_64-latest.xml | 1 + .../net-isolated-port.x86_64-latest.xml | 1 + .../qemuxml2xmloutdata/pcie-expander-bus.xml | 1 + .../pcie-root-port-model-generic.xml | 1 + .../pcie-root-port-model-ioh3420.xml | 1 + ...pcie-root-port-nohotplug.x86_64-latest.xml | 1 + tests/qemuxml2xmloutdata/pcie-root-port.xml | 1 + tests/qemuxml2xmloutdata/pcie-root.xml | 1 + .../pcie-switch-downstream-port.xml | 1 + .../pcie-switch-upstream-port.xml | 1 + tests/qemuxml2xmloutdata/pcihole64-q35.xml | 1 + ...q35-default-devices-only.x86_64-latest.xml | 1 + .../q35-multifunction.x86_64-latest.xml | 1 + .../q35-pci-force-address.xml | 1 + .../q35-pcie-autoadd.x86_64-latest.xml | 1 + .../q35-pcie.x86_64-latest.xml | 1 + tests/qemuxml2xmloutdata/q35-usb2-multi.xml | 1 + tests/qemuxml2xmloutdata/q35-usb2-reorder.xml | 1 + tests/qemuxml2xmloutdata/q35-usb2.xml | 1 + .../q35-virt-manager-basic.x86_64-latest.xml | 1 + tests/qemuxml2xmloutdata/q35.xml | 1 + .../tseg-explicit-size.x86_64-latest.xml | 1 + .../usb-controller-default-q35.xml | 1 + .../usb-controller-explicit-q35.xml | 1 + .../virtio-iommu-x86_64.x86_64-latest.xml | 1 + .../virtio-non-transitional.x86_64-latest.xml | 1 + .../virtio-transitional.x86_64-latest.xml | 1 + .../watchdog-q35-multiple.x86_64-latest.xml | 1 + ...-default-cpu-kvm-q35-4.2.x86_64-latest.xml | 1 + ...-default-cpu-tcg-q35-4.2.x86_64-latest.xml | 1 + .../x86_64-q35-graphics.x86_64-latest.xml | 1 + .../x86_64-q35-headless.x86_64-latest.xml | 1 + 136 files changed, 256 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 2eb5653254e1..af9d6a9e6258 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3996,6 +3996,7 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, bool addDefaultUSBKBD =3D false; bool addDefaultUSBMouse =3D false; bool addPanicDevice =3D false; + bool addITCOWatchdog =3D false; =20 /* add implicit input devices */ if (qemuDomainDefAddImplicitInputDevice(def) < 0) @@ -4012,6 +4013,7 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, if (qemuDomainIsQ35(def)) { addPCIeRoot =3D true; addImplicitSATA =3D true; + addITCOWatchdog =3D true; =20 /* Prefer adding a USB3 controller if supported, fall back * to USB2 if there is no USB3 available, and if that's @@ -4231,6 +4233,27 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, } } =20 + if (addITCOWatchdog) { + size_t i =3D 0; + + for (i =3D 0; i < def->nwatchdogs; i++) { + if (def->watchdogs[i]->model =3D=3D VIR_DOMAIN_WATCHDOG_MODEL_= ITCO) + break; + } + + if (i =3D=3D def->nwatchdogs) { + virDomainWatchdogDef *watchdog =3D g_new0(virDomainWatchdogDef= , 1); + + watchdog->model =3D VIR_DOMAIN_WATCHDOG_MODEL_ITCO; + if (def->nwatchdogs) + watchdog->action =3D def->watchdogs[0]->action; + else + watchdog->action =3D VIR_DOMAIN_WATCHDOG_ACTION_RESET; + + VIR_APPEND_ELEMENT(def->watchdogs, def->nwatchdogs, watchdog); + } + } + if (qemuDomainDefAddDefaultAudioBackend(driver, def) < 0) return -1; =20 @@ -6469,6 +6492,27 @@ qemuDomainDefFormatBufInternal(virQEMUDriver *driver, */ if (qemuDomainDefClearDefaultAudioBackend(driver, def) < 0) return -1; + + /* Old libvirt did not know about the iTCO watchdog in q35 machine + * types, but nevertheless it was always present. Remove it if it= has + * the default action set. */ + if (qemuDomainIsQ35(def)) { + virDomainWatchdogDef *watchdog =3D NULL; + + for (i =3D 0; i < def->nwatchdogs; i++) { + if (def->watchdogs[i]->model =3D=3D VIR_DOMAIN_WATCHDOG_MO= DEL_ITCO) + break; + } + + if (i < def->nwatchdogs) { + watchdog =3D def->watchdogs[i]; + + if (watchdog->action =3D=3D VIR_DOMAIN_WATCHDOG_ACTION_RES= ET) { + VIR_DELETE_ELEMENT(def->watchdogs, i, def->nwatchdogs); + virDomainWatchdogDefFree(watchdog); + } + } + } } =20 format: diff --git a/tests/qemustatusxml2xmldata/vcpus-multi-in.xml b/tests/qemusta= tusxml2xmldata/vcpus-multi-in.xml index e71d6a83c70b..648eafc64c0c 100644 --- a/tests/qemustatusxml2xmldata/vcpus-multi-in.xml +++ b/tests/qemustatusxml2xmldata/vcpus-multi-in.xml @@ -338,6 +338,7 @@