From nobody Sun Feb 8 07:52:49 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=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1696974203; cv=none; d=zohomail.com; s=zohoarc; b=d93eETWRkETdPV1ELHKAIrulEpdV9C3qlLSc3gY6hfJGhqPbS/dAd6D2rN9Zl08f41/Xrurf6y6F6kbV7nwN/W/6re5l0wRG3RTn2Nmxz81hiaUEySq8ZNrtOR0/mFVWMOjz1hgPkZFbX9bFcJNTzYGhqiGQtSbSiJlso01XEwc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696974203; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hDHRokRPDP3PLfLWHCfaHmnT8aceH3OPzvJgpYC2hgQ=; b=P5kjebyz9o4aaMDTAooppXDPxgZrtSGQDVHHumjljktNnvQzfZ0WfgcBExZ+ldqK6SF4ADhDX20ZFUjnC1bfTM2ePTtgNXoulWwBKO6oSycwrCzvKheX1Xrabe0C60brmHLK+o0iGslBSn30eFvqS8LmjTl/5Q9r6ZvWs9cyvFM= 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=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.129.124]) by mx.zohomail.com with SMTPS id 1696974203398696.5730166223501; Tue, 10 Oct 2023 14:43:23 -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-QYTSV2wfO_yq055Ee2SRPg-1; Tue, 10 Oct 2023 17:43:19 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (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 BC868101A53B; Tue, 10 Oct 2023 21:43:16 +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 A870B2062BE8; Tue, 10 Oct 2023 21:43:16 +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 6E0E519465B8; Tue, 10 Oct 2023 21:43:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 743861946597 for ; Tue, 10 Oct 2023 21:43:15 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4A2422062BE8; Tue, 10 Oct 2023 21:43:15 +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 42B052062BEC for ; Tue, 10 Oct 2023 21:43:15 +0000 (UTC) Received: from us-smtp-inbound-delivery-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 24FCD8582B4 for ; Tue, 10 Oct 2023 21:43:15 +0000 (UTC) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by relay.mimecast.com with ESMTP id us-mta-590-E-5h5myqOSKwYvevXFQwDA-1; Tue, 10 Oct 2023 17:43:08 -0400 Received: from home-fedora.. (072-191-074-189.res.spectrum.com [72.191.74.189]) by linux.microsoft.com (Postfix) with ESMTPSA id 652DF20B74C2; Tue, 10 Oct 2023 14:43:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696974202; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=hDHRokRPDP3PLfLWHCfaHmnT8aceH3OPzvJgpYC2hgQ=; b=JvDLWX8C39vD0STHXdR3HTeevTGF5c0/Zkn9eK3gcNoqZgMBSymg81AM+3Fz+jKGj/ulbJ xi0QYhb29hySCve0+0PNuY+VZJh9CfPsPKHS72cdTCv8MW7uRpSan9AsD6ZgApe9B7lSXK xc4i97kzOPhubDu5T71anm1XVpIOEmM= X-MC-Unique: QYTSV2wfO_yq055Ee2SRPg-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: E-5h5myqOSKwYvevXFQwDA-1 DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 652DF20B74C2 From: Praveen K Paladugu To: libvir-list@redhat.com Subject: [libvirt PATCH 2/2] ch: support serial and console devices in parallel Date: Tue, 10 Oct 2023 16:42:58 -0500 Message-ID: <20231010214258.51894-3-prapal@linux.microsoft.com> In-Reply-To: <20231010214258.51894-1-prapal@linux.microsoft.com> References: <20231010214258.51894-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.6 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: , Cc: liuwe@microsoft.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linux.microsoft.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1696974203960100005 Content-Type: text/plain; charset="utf-8"; x-default="true" Starting v18, cloud-hypervisor supports serial and console devices in parallel. Drop related check based on ch version. Signed-off-by: Praveen K Paladugu --- src/ch/ch_domain.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/ch/ch_domain.c b/src/ch/ch_domain.c index 866f0d899a..c0d6c75b1d 100644 --- a/src/ch/ch_domain.c +++ b/src/ch/ch_domain.c @@ -142,10 +142,11 @@ virDomainXMLPrivateDataCallbacks virCHDriverPrivateDa= taCallbacks =3D { =20 static int chValidateDomainDeviceDef(const virDomainDeviceDef *dev, - const virDomainDef *def G_GNUC_UNUSED, - void *opaque G_GNUC_UNUSED, + const virDomainDef *def, + void *opaque, void *parseOpaque G_GNUC_UNUSED) { + virCHDriver *driver =3D opaque; switch (dev->type) { case VIR_DOMAIN_DEVICE_DISK: case VIR_DOMAIN_DEVICE_NET: @@ -191,18 +192,25 @@ chValidateDomainDeviceDef(const virDomainDeviceDef *d= ev, return -1; } =20 - if ((def->nconsoles && - def->consoles[0]->source->type =3D=3D VIR_DOMAIN_CHR_TYPE_PTY) - && (def->nserials && - def->serials[0]->source->type =3D=3D VIR_DOMAIN_CHR_TYPE_PTY))= { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + if (!virBitmapIsBitSet(driver->chCaps, CH_SERIAL_CONSOLE_IN_PARALLEL))= { + if ((def->nconsoles && + def->consoles[0]->source->type =3D=3D VIR_DOMAIN_CHR_TYPE_= PTY) + && (def->nserials && + def->serials[0]->source->type =3D=3D VIR_DOMAIN_CHR_TYPE_P= TY)) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Only a single console or serial can be configure= d for this domain")); - return -1; - } else if (def->nconsoles > 1) { + return -1; + } + } + + + if (def->nconsoles > 1) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Only a single console can be configured for this= domain")); return -1; - } else if (def->nserials > 1) { + } + + if (def->nserials > 1) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Only a single serial can be configured for this = domain")); return -1; --=20 2.41.0