From nobody Sat Nov 23 05:36:54 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=1681913291; cv=none; d=zohomail.com; s=zohoarc; b=ftSb+cE2E39c6nldFLAZukcEbtEt9ZJygWBXJi7zaOjZSu+0KjQBZvemdfaKw+3/vMHS1HzCyI69WFIoeKW1gNA3knRHFfO+F+r3Z/kEx0L4uySF74BTalQW7ZaFpjfEK9WW9tetvxsodC8JmoRjBmSXb6SHnRxPZIghlX7FXcY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681913291; 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=6eTI5oGx5QUnCO8PY9Qgvu5ZDzQP+x/RQPshcsrl6oM=; b=Ld/kcsIJzLWZ7u8VG0j2Gsbh2Kz9FHzFcOnGmxUlGFIFDlPNz/wUvBOLtj4O9V3mzAzsfq+etDeApxFaZMPBoglNNYVfRDH9HsZVTIZ/LvPalA99Fr5x+s8GTgRGj3ifEfT1EAMOlgGn9I+CT2rgMG1NeQrgkCy6GfVrtZRite8= 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 1681913291282783.9922347981418; Wed, 19 Apr 2023 07:08:11 -0700 (PDT) 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-621-ExYOkeYuPNS8LprQwE5Siw-1; Wed, 19 Apr 2023 10:08:06 -0400 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 B20D11C0896A; Wed, 19 Apr 2023 14:08:00 +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 9C3BD40C2064; Wed, 19 Apr 2023 14:08:00 +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 7929E19465B1; Wed, 19 Apr 2023 14:08:00 +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 90C8619465A0 for ; Wed, 19 Apr 2023 14:07:27 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 822C75AB7A; Wed, 19 Apr 2023 14:07:27 +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 7B7492958 for ; Wed, 19 Apr 2023 14:07:27 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.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 5EC378996FB for ; Wed, 19 Apr 2023 14:07:27 +0000 (UTC) Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-225-hBjPS23lPyC-qhCogWBMvQ-1; Wed, 19 Apr 2023 10:07:25 -0400 Received: by mail-pf1-f197.google.com with SMTP id d2e1a72fcca58-63b4e5fdad0so2864929b3a.0 for ; Wed, 19 Apr 2023 07:07:24 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-u.redhat.com. [213.175.37.12]) by smtp.gmail.com with ESMTPSA id 23-20020aa79117000000b0062dd8809d6esm11029185pfh.150.2023.04.19.07.07.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:07:23 -0700 (PDT) Received: from wheatley.. (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id F3116FB38651 for ; Wed, 19 Apr 2023 16:07:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681913290; 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=6eTI5oGx5QUnCO8PY9Qgvu5ZDzQP+x/RQPshcsrl6oM=; b=FHWj9Bse5px9TnF+BPc+GY5HdFpwGKvSUhlrIp+b6r44vYt13BOpsUq3ms4p5lLLMxgrBN 3/mMJJ0dW7M1RGkbQhOMNcWrhexMPZO7bZYKuRoRYMwfxD1tkQbTG7GLOJs2qfwX+BhcZS N+hUj49y4JfG2dCqCtd8e0scQ9KBC6c= X-MC-Unique: ExYOkeYuPNS8LprQwE5Siw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: hBjPS23lPyC-qhCogWBMvQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681913244; x=1684505244; 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=6eTI5oGx5QUnCO8PY9Qgvu5ZDzQP+x/RQPshcsrl6oM=; b=bfVKm5VTmCGCaBlxoDmnoEL8tDyL+WqY0HHbjWNN4UQcGB0xqF+AcxlcQTr/dkBSfz uy5qmrhQjkEO86IdvFDkAdeUec17IjEgxuBFJaDs9K6/4DqTE6F5p++aRlGzynbI30Wd OBhmzaCdPt5SF2P7yq+BXAvRxZR/5FhdQgmIPZnyVZ59t/XPEeF1H1zdmgGdjDl3Gpq/ PswUvE/w8e7ebKT4sWEL0KEsTtAcFsGQvp30HOgXZrTGI+wOV2nufFUo/db9dO6mCah+ VHTxsdFimhJXJsbkQNz5WY02UiyHte/VVDavnrvmQOs/fO04aFcI9BN0OgITQyr1K1nY MMdQ== X-Gm-Message-State: AAQBX9e2Ts+akIv9FhKhToPkw2Rfd75HgJ6erzKwM6Uo+Pqc69e0sBqp gwt7AQESymEql+DDWYS59vjpSomSz/DjubMqGrt95NTjo8szfRjtLT3m9LRF1Oc6tzHGDxbPSDk GbwopUxWBs/2nHI3305E8ZHbpd6jpfIB7ScrZfx6ExAgS6vBxpXZcPmmcYbcfidD6RCHQ0kNTmU /0WWB5Qg== X-Received: by 2002:a05:6a00:1898:b0:63d:3411:f9ec with SMTP id x24-20020a056a00189800b0063d3411f9ecmr4314175pfh.20.1681913243907; Wed, 19 Apr 2023 07:07:23 -0700 (PDT) X-Google-Smtp-Source: AKy350b7f8E0fnz6VPtQSGsRzpzazS3qHMeehLCKr7SwwvFaLJ+urdn4sHJj+vOYeqxMyxUh1LqTnw== X-Received: by 2002:a05:6a00:1898:b0:63d:3411:f9ec with SMTP id x24-20020a056a00189800b0063d3411f9ecmr4314155pfh.20.1681913243591; Wed, 19 Apr 2023 07:07:23 -0700 (PDT) From: Martin Kletzander To: libvir-list@redhat.com Subject: [PATCH 7/7] qemu: Forbid most duplicated watchdogs Date: Wed, 19 Apr 2023 16:07:10 +0200 Message-Id: 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: 1681913292405100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Most of them are platform devices and only i6300esb can be plugged multiple times into different PCI slots. Signed-off-by: Martin Kletzander --- src/qemu/qemu_validate.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index b2c3fd1785bc..2b205348f597 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1110,19 +1110,21 @@ qemuValidateDomainDefTPMs(const virDomainDef *def) static int qemuValidateDomainDefWatchdogs(const virDomainDef *def) { - bool found_itco =3D false; + bool watchdogs[VIR_DOMAIN_WATCHDOG_MODEL_LAST] =3D {0}; size_t i =3D 0; =20 for (i =3D 0; i < def->nwatchdogs; i++) { + if (def->watchdogs[i]->model =3D=3D VIR_DOMAIN_WATCHDOG_MODEL_I630= 0ESB) + continue; =20 - if (def->watchdogs[i]->model =3D=3D VIR_DOMAIN_WATCHDOG_MODEL_ITCO= ) { - if (found_itco) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Multiple iTCO watchdogs are not supporte= d")); - return -1; - } - found_itco =3D true; + if (watchdogs[def->watchdogs[i]->model]) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("domain can only have one watchdog with model= '%1$s'"), + virDomainWatchdogModelTypeToString(def->watchdo= gs[i]->model)); + return -1; } + + watchdogs[def->watchdogs[i]->model] =3D true; } =20 return 0; --=20 2.40.0