From nobody Sun Feb 8 01:34:05 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1607466086; cv=none; d=zohomail.com; s=zohoarc; b=MF7jLZFcKRlxi6cxuXui+enCX2a9oHqHZQWLWFqokXPTbgc9rlmMpowobKcaRrNk1nICQSt1svgC7FUyWEDPAdluillqABCUW3ERgVygvmQvJuTIArk9IP5qFNWs2d9DUty6iMpBoE+0RnD91yUUPqOdLonnizG7WonfrH/3GrU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607466086; h=Content-Type:Content-Transfer-Encoding:Cc: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=mpVh/x0g+CTzSlB8PtFe0LN0mTd2gGyr9fB7PNwSifU=; b=Hhv4mDcN8gw3paveA2LXx/h6IfoiU3FCC6Sql1HPLLuxoZh5TiP6CZbDHOQKzipJFq/JwNofk700TNZ9vnCAuOYBITEg/8WegduoKxjWouKdPeE1U998M0GZUmQG8dYjveR878oCIdCOhwDz6H/k7l1cmu9z5AJlmwv/P+wtq/M= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1607466086686117.18982737999454; Tue, 8 Dec 2020 14:21:26 -0800 (PST) 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-274-mDkrnEWjOjazLfVfn-MUZQ-1; Tue, 08 Dec 2020 17:21:23 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 90972100F34A; Tue, 8 Dec 2020 22:21:16 +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 6DA9C60BF3; Tue, 8 Dec 2020 22:21:16 +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 05B2250032; Tue, 8 Dec 2020 22:21:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0B8MLE4C017365 for ; Tue, 8 Dec 2020 17:21:14 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6CC401004145; Tue, 8 Dec 2020 22:21:14 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 686D1112D41B for ; Tue, 8 Dec 2020 22:21:13 +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-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 847E2100B16A for ; Tue, 8 Dec 2020 22:21:13 +0000 (UTC) Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-515-mrcnLvcLMvG4ktRp2ad1Nw-1; Tue, 08 Dec 2020 17:21:08 -0500 Received: by mail-qk1-f196.google.com with SMTP id 19so206244qkm.8; Tue, 08 Dec 2020 14:21:08 -0800 (PST) Received: from rekt.redhat.com ([2804:431:c7c7:c1a:69c1:2b22:e880:fc49]) by smtp.gmail.com with ESMTPSA id c14sm75057qtg.85.2020.12.08.14.21.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Dec 2020 14:21:07 -0800 (PST) X-MC-Unique: mDkrnEWjOjazLfVfn-MUZQ-1 X-MC-Unique: mrcnLvcLMvG4ktRp2ad1Nw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mpVh/x0g+CTzSlB8PtFe0LN0mTd2gGyr9fB7PNwSifU=; b=iDtl7vuO3Rj9NQEtvbRJYMfAF0ntgwup9lULEwzgy6DnvMBDkcFh0HSVEu9YYtg83W hq8gQRHGz6BBvJH5OT7FrLitBKZ6Dm0K5jtO+TS3KJIY64kfh3MVZze2JH6O2Tz9EeRO tgHHqoeG4uKc/zf5W1kqSg0/VXyoywyu34clXu48Vcl+maZpc6q/cEXiVnwW5w2esb1X TV9ZLefTA7bNNUskFFT3syr4m8YPNmBsm1gkZ7K/qL6PCv38nxGXn/NbsQofprx0y43Q NS1FbQkYhyc4RNpETc2RSt0pk6pdkhnCk4uBNsaZuQmkhzLBG8/NbfuT/VAhShXPS8Kz /yEg== X-Gm-Message-State: AOAM5332KaZxDyrBvMo/65Z2UvnzW0tjBVXZqHZFI/Fdsr9TAtnoWSjU wRKwybjdZIu7aGrH9r+hppGG9A76TfI= X-Google-Smtp-Source: ABdhPJwDHJ9inXUQCI/TMOO5mlx+46rTZ++RfpzQLkZqxNTm3GWyh+tlOp8uKyk4sVYPeWCqxFwl0A== X-Received: by 2002:a37:b346:: with SMTP id c67mr25974894qkf.69.1607466067597; Tue, 08 Dec 2020 14:21:07 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v3 09/14] domain_conf.c: move smartcard address check to domain_validate.c Date: Tue, 8 Dec 2020 19:20:25 -0300 Message-Id: <20201208222030.1302229-10-danielhb413@gmail.com> In-Reply-To: <20201208222030.1302229-1-danielhb413@gmail.com> References: <20201208222030.1302229-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: Michal Privoznik , Daniel Henrique Barboza 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.12 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 Content-Type: text/plain; charset="utf-8" This check is not tied to XML parsing and can be moved to virDomainSmartcardDefValidate(). Reviewed-by: Michal Privoznik Signed-off-by: Daniel Henrique Barboza --- src/conf/domain_conf.c | 7 ------- src/conf/domain_validate.c | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index a301ab5c74..a5dcb0bbce 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -13222,13 +13222,6 @@ virDomainSmartcardDefParseXML(virDomainXMLOptionPt= r xmlopt, if (virDomainDeviceInfoParseXML(xmlopt, node, &def->info, flags) < 0) return NULL; =20 - if (def->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && - def->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCID) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Controllers must use the 'ccid' address type")); - return NULL; - } - return g_steal_pointer(&def); } =20 diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index 882fbdac57..6fca604d17 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -484,6 +484,13 @@ int virDomainSmartcardDefValidate(const virDomainSmartcardDef *smartcard, const virDomainDef *def) { + if (smartcard->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && + smartcard->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCID) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Controllers must use the 'ccid' address type")); + return -1; + } + if (smartcard->type =3D=3D VIR_DOMAIN_SMARTCARD_TYPE_PASSTHROUGH) return virDomainChrSourceDefValidate(smartcard->data.passthru, NUL= L, def); =20 --=20 2.26.2