From nobody Tue Feb 10 10:59:32 2026 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658400435; cv=none; d=zohomail.com; s=zohoarc; b=JsPOQPKd3lg6O2aXnixsoCP7XJe3GuHf5GcfmM6Y+bZdhoGiKuGrGV5v3mf3X2PZwubKUvUaF6/zvdNSKg1ybs2kK1zxUcXpJQKLOGWPfqbcpZy5F84hvx2qrKmrTN25IAtU4fLDu1VdDaUdCfx76AXr7Oj3VM99Uq1+Y42f3NA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658400435; 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=UOsGerUwuH6ZLhNAPqKTSD7+FLjJFwJaE/cdZThnEOk=; b=JtHfNY8Nu7eq7Owy/H5q45d4nDuc6TbNHUOkpYym40lddly3Ehk/L12UHCMONVbJvPERzd3VIQ0qhM4RtyHZ+NMl9irok1Zct9UCz72Q385YPHkeTzWOpnUp17vgTMSHmWBAEUPf/RzrDEUybxD0W9YACC9rdv57dz4v2/0UtK8= 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=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.133.124]) by mx.zohomail.com with SMTPS id 1658400435031237.1539715407239; Thu, 21 Jul 2022 03:47: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-22-v1_yqi9cOGG7T8dqJGnLUQ-1; Thu, 21 Jul 2022 06:46:17 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7B3DD1034ADF; Thu, 21 Jul 2022 10:46:14 +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 65F72404D883; Thu, 21 Jul 2022 10:46:14 +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 BE2231947077; Thu, 21 Jul 2022 10:46:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A1BC61947043 for ; Thu, 21 Jul 2022 10:46:11 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 836D340CFD0A; Thu, 21 Jul 2022 10:46:11 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2C09340CF916 for ; Thu, 21 Jul 2022 10:46:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658400434; 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=UOsGerUwuH6ZLhNAPqKTSD7+FLjJFwJaE/cdZThnEOk=; b=RxeflCcmIpuPZkNUSO1PuQJ9TBk6YtYqzitXuNTrXx7mJYm3AYtW840Olj+Lze1Oltyrl2 Y4hHZ6HaR3UF/i0ovyHi/LsRiNdwEpleS+dAv3DyoziS4hutJ0nJFhZO0PxuUddfOI77zS agys64VO6Te6GfyOfvKRSWqWMTpA2m4= X-MC-Unique: v1_yqi9cOGG7T8dqJGnLUQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvirt-list@redhat.com Subject: [PATCH v2 5/8] domain_conf: extend switch with if in virDomainChrDefFree() Date: Thu, 21 Jul 2022 12:45:50 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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.84 on 10.11.54.2 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: 1658400435420100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Switch is used for just one case, but a more future proof approach is to handle all enum values. Signed-off-by: Kristina Hanicova Reviewed-by: Martin Kletzander --- src/conf/domain_conf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b903dac1cb..41eb105a6c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2904,7 +2904,7 @@ void virDomainChrDefFree(virDomainChrDef *def) if (!def) return; =20 - switch (def->deviceType) { + switch ((virDomainChrDeviceType)def->deviceType) { case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL: switch (def->targetType) { case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD: @@ -2918,7 +2918,10 @@ void virDomainChrDefFree(virDomainChrDef *def) } break; =20 - default: + case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL: + case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL: + case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE: + case VIR_DOMAIN_CHR_DEVICE_TYPE_LAST: break; } =20 --=20 2.35.3