From nobody Tue Feb 10 04:03:23 2026 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=1653571395; cv=none; d=zohomail.com; s=zohoarc; b=ZJs/yMw8OGhoF94ootN0YVLowqVkfyqiq7Db+QoL3+DqIGW9hcnPy5xDK1DmvEC9iJmut69QRCs+uN/JF4s77VgvD+9EdfeleBdPhus2ireMS/m/7PqUmWdieKCmh7poDZIZT0azwG3V/rYwgvEg0ZkuMLRmjokBsIkIeGRK4RE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653571395; 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=r8gxUWYFdNm3n2SykhTnQO4DH9LZ3tWecm82Ycon5Cg=; b=juVrGGzRqHMP80zGflM2TxpVi3B3O2XAp9cVJZeaQPfV7bDHqHmZs11cL3/YkMW5nBSkFs8UCcJ1opRGSP3K8UxQd7kDmxCSL0VroOgom+DuiBrcszj9BdqTFEPpxrzMqSE59He+MC2AmJkWNdgDbiTtseJ7AK9/gF8xgEtHHXQ= 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 165357139584493.62159265551213; Thu, 26 May 2022 06:23:15 -0700 (PDT) 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-465-D4ZCtxH7MCWvz46_l7Ixtg-1; Thu, 26 May 2022 09:23:12 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 241C4100BABF; Thu, 26 May 2022 13:23:07 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id C77FA2026D07; Thu, 26 May 2022 13:23:06 +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 98FAF193212B; Thu, 26 May 2022 13:23:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6D2681932102 for ; Thu, 26 May 2022 13:23:01 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 53C461121315; Thu, 26 May 2022 13:23:01 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id EFF8F112131B for ; Thu, 26 May 2022 13:23:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653571394; 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=r8gxUWYFdNm3n2SykhTnQO4DH9LZ3tWecm82Ycon5Cg=; b=D2JlXRGbH1Iyva1X3XLRVXaruubcNHAQI1MSp4FIiJM6Xx275XvjzKuxkhdjTizPUdfgTO nWJVhq/gxyM2BJQUF9WnTDgGk/g2RP4Bae0sFavn5IDa6J+kJ2ciT8Cx/G2YEoDC7Sux2T p4kGWzJUEXl6v87N6VlyRWGeEMfup28= X-MC-Unique: D4ZCtxH7MCWvz46_l7Ixtg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/2] virDomainInputDefValidate: Validate model Date: Thu, 26 May 2022 15:22:58 +0200 Message-Id: <814ae91c777e9ba6d2d9db3c95baf99eab944e05.1653571362.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 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 2.78 on 10.11.54.4 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1653571397213100003 Content-Type: text/plain; charset="utf-8"; x-default="true" If input device has one of virtio* models set then it has to go onto virtio bus. Introduce such check into the validator. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2081981 Signed-off-by: Michal Privoznik --- src/conf/domain_validate.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index 1feb7a8f9c..f3910f08a4 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -2306,6 +2306,27 @@ virDomainInputDefValidate(const virDomainInputDef *i= nput, return -1; } =20 + switch ((virDomainInputModel)input->model) { + case VIR_DOMAIN_INPUT_MODEL_VIRTIO: + case VIR_DOMAIN_INPUT_MODEL_VIRTIO_TRANSITIONAL: + case VIR_DOMAIN_INPUT_MODEL_VIRTIO_NON_TRANSITIONAL: + if (input->bus !=3D VIR_DOMAIN_INPUT_BUS_VIRTIO) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("only bus 'virtio' is supported for input mod= el '%s'"), + virDomainInputModelTypeToString(input->model)); + return -1; + } + break; + + case VIR_DOMAIN_INPUT_MODEL_DEFAULT: + break; + + case VIR_DOMAIN_INPUT_MODEL_LAST: + default: + virReportEnumRangeError(virDomainInputModel, input->model); + return -1; + } + return 0; } =20 --=20 2.35.1