From nobody Sun Apr 28 04:21:08 2024 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=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1675980997; cv=none; d=zohomail.com; s=zohoarc; b=BAEd4zuVURyn2s4AtlR92iAByteR+Wn3BF+649wyXXkgtFLAJaPDxxoGcBtXWMvU6kL7j5iVg9QJwZmNi3YXS4bTZxMPkqkOTeeGr+h9wFP3zV1ZBvN0jfjlr3zN6AP6C5gDPk5qiQ8FU8qZjILQ1Gp/qtPFGVBSnUgel0WixXo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675980997; 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=wV0khxe3w2nycTVuRdf91+zkzjfd8G9ZM4RCAUqAG8Q=; b=dYPOZSSxC8aOi4Q4+pKUtuVBKr2SNlIkReo5rnYb0uMTqGahTz0h6MATm7lQIUWjpRzXxDYX+nOisRjOJNS+SOBDTxHe5XIH5b/r/hVTmm0kDOfpPx65SQTYWfuOgNRWjbgIW/ByExVRnbu1eQGQtNNUQXNNfLg2Bm80GEO3Z0I= 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=fail 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 1675980997713376.5894498867141; Thu, 9 Feb 2023 14:16:37 -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-370-fnN3rLtPPtSVE6DuWSUMQA-1; Thu, 09 Feb 2023 17:16:34 -0500 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 0C8C11C04B64; Thu, 9 Feb 2023 22:16:27 +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 4968B2026D68; Thu, 9 Feb 2023 22:16:25 +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 545C7194658D; Thu, 9 Feb 2023 22:16:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D3FA4194658D for ; Thu, 9 Feb 2023 22:16:11 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id DA855492B00; Thu, 9 Feb 2023 22:16:10 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D13AB492C3F for ; Thu, 9 Feb 2023 22:16:10 +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 B3E2485A588 for ; Thu, 9 Feb 2023 22:16:10 +0000 (UTC) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by relay.mimecast.com with ESMTP id us-mta-447-tdkgGAOVPROQANKYpCQzVg-1; Thu, 09 Feb 2023 17:16:08 -0500 Received: from prapal-ch3.oiwy50ateaxezb1sqsoezlib2f.xx.internal.cloudapp.net (unknown [20.94.236.122]) by linux.microsoft.com (Postfix) with ESMTPSA id AB57C20C8AF6 for ; Thu, 9 Feb 2023 14:09:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675980996; 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=wV0khxe3w2nycTVuRdf91+zkzjfd8G9ZM4RCAUqAG8Q=; b=QkHCg9hTev4hEnSfruX3k/fFe/9W5tprm9Q8VqML4GtW7ghq1WJz2qzidwVakeT9CE8VP3 xI7HtsNm6KPq+g4I7sozPeLPvCPWk1E+F/DUHVXQNj+/fZ+mK/AkZtkJjQYwvqGPTy7Vui o3+gO8w4f23+n5QW1ebwcZyWs0tU/To= X-MC-Unique: fnN3rLtPPtSVE6DuWSUMQA-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: tdkgGAOVPROQANKYpCQzVg-1 DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com AB57C20C8AF6 From: Praveen K Paladugu To: libvir-list@redhat.com Subject: [libvirt PATCH 1/1] ch: Do not add stub console to ch VMs Date: Thu, 9 Feb 2023 22:09:28 +0000 Message-Id: <20230209220928.26051-2-prapal@linux.microsoft.com> In-Reply-To: <20230209220928.26051-1-prapal@linux.microsoft.com> References: <20230209220928.26051-1-prapal@linux.microsoft.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 3.1 on 10.11.54.9 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.4 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: 1675980999435100002 Content-Type: text/plain; charset="utf-8"; x-default="true" virDomainDefAddConsoleCompat in post parsing step appends a stub console of type VIR_DOMAIN_CHR_TYPE_NULL to ch VMs' Domain XML. Cloud-hypervisor's deviceValidateCallback (chValidateDomainDeviceDef) checks that the type of stub console is not of type VIR_DOMAIN_CHR_TYPE_PTY and throws an error. This commit introduces NO_STUB_CONSOLE feature check to Domain features and uses it to skip adding stub console to ch VMs. Signed-off-by: Praveen K Paladugu Reviewed-by: Michal Privoznik --- src/ch/ch_domain.c | 1 + src/conf/domain_conf.c | 7 ++++--- src/conf/domain_conf.h | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ch/ch_domain.c b/src/ch/ch_domain.c index 83defbb416..cf98654479 100644 --- a/src/ch/ch_domain.c +++ b/src/ch/ch_domain.c @@ -262,6 +262,7 @@ virDomainDefParserConfig virCHDriverDomainDefParserConf= ig =3D { .domainPostParseBasicCallback =3D virCHDomainDefPostParseBasic, .domainPostParseCallback =3D virCHDomainDefPostParse, .deviceValidateCallback =3D chValidateDomainDeviceDef, + .features =3D VIR_DOMAIN_DEF_FEATURE_NO_STUB_CONSOLE, }; =20 virCHMonitor * diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index ff1c78ecd1..a5578324b9 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -21751,9 +21751,10 @@ virDomainDefAddImplicitVideo(virDomainDef *def, vi= rDomainXMLOption *xmlopt) int virDomainDefAddImplicitDevices(virDomainDef *def, virDomainXMLOption *xmlo= pt) { - if (virDomainDefAddConsoleCompat(def) < 0) - return -1; - + if ((xmlopt->config.features & VIR_DOMAIN_DEF_FEATURE_NO_STUB_CONSOLE)= =3D=3D 0) { + if (virDomainDefAddConsoleCompat(def) < 0) + return -1; + } if (virDomainDefAddImplicitControllers(def) < 0) return -1; =20 diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index e684edcf95..62f80d653d 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3231,6 +3231,7 @@ typedef enum { VIR_DOMAIN_DEF_FEATURE_FW_AUTOSELECT =3D (1 << 7), VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING =3D (1 << 8), VIR_DOMAIN_DEF_FEATURE_DISK_FD =3D (1 << 9), + VIR_DOMAIN_DEF_FEATURE_NO_STUB_CONSOLE =3D (1 << 10), } virDomainDefFeatures; =20 =20 --=20 2.34.1