From nobody Mon Feb 9 00:42:18 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=1653311405; cv=none; d=zohomail.com; s=zohoarc; b=YEab93Mc0iYplYs18O5tTr1uaNYWjnNw/quqUOjuNBoVyKM9oDorCZtRNaQWL92/nnAdztBGEbzkL7dST0UVbQAbKZDZ0xrsLU+rYA6hw92onhuwRnOVtlwSY8YXP2++WzaOT7CcyWKMxQZNSnJfzTZeE2yNhMrKDA6iOUAgOLI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653311405; 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=SV1Tg3DRxI9OcJllpleL61eGUew7hBg0n0sndCX1HuE=; b=c+Vw/f5UaTBO+vVY76FxkgZRI2ig59xUx24O+ZumH7ilwIq2lA3mJTJ/zadh3AYdZJflyILNB1SyjpZWAt6l5tsRr1BpCOeXZ8QZmouE+a1VuVGXyIbswaeOhSaApPjzhRa9xHT+ODw6CqXD0CmzT5wFRLbOSAfHl10QHE3DWcc= 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 1653311405110165.97243645950834; Mon, 23 May 2022 06:10:05 -0700 (PDT) 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-173-z_5Pj2dVOnuX3H2Tdf2qdQ-1; Mon, 23 May 2022 09:09:10 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 500CE1C01B3D; Mon, 23 May 2022 13:08:58 +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 39E06401E74; Mon, 23 May 2022 13:08:58 +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 C9306194705A; Mon, 23 May 2022 13:08:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 252BE1947059 for ; Mon, 23 May 2022 13:08:56 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 18653400E115; Mon, 23 May 2022 13:08:56 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id B40FC40C1438 for ; Mon, 23 May 2022 13:08:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653311404; 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=SV1Tg3DRxI9OcJllpleL61eGUew7hBg0n0sndCX1HuE=; b=AdJ5DumXhiWvYtksJr6Bgv8Ugz4/ATUD1wk98T4BB6DIWhuBzbJ5j1tjNgJ7F2M528hYyg QilXI5Csoz3z9LR7VoS5f8p0QeheHvgXY4/DjV7Z/KxHfvPoOKVZ5pZNgCINGS24SLAYIz c1+2F9fGPMe3wEtEgvlyIjjQSmMuhNE= X-MC-Unique: z_5Pj2dVOnuX3H2Tdf2qdQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 01/17] Drop needless typecast to virStorageType enum Date: Mon, 23 May 2022 15:08:36 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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.85 on 10.11.54.10 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: 1653311406798100003 Content-Type: text/plain; charset="utf-8"; x-default="true" There are three places (two in domain_conf.c and one in qemu_migration.c) where a virStorageSource->type is typecasted to virStorageType (for the purpose of catching missing enum member in a switch() statement at compile time). This is needless, because as of v8.2.0-rc1~120 the struct member is of proper type. Signed-off-by: Michal Privoznik Reviewed-by: Boris Fiuczynski --- src/conf/domain_conf.c | 4 ++-- src/qemu/qemu_migration.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 0b30ebc96b..6ff994dd12 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -8659,7 +8659,7 @@ virDomainStorageSourceParse(xmlNodePtr node, =20 ctxt->node =3D node; =20 - switch ((virStorageType)src->type) { + switch (src->type) { case VIR_STORAGE_TYPE_FILE: src->path =3D virXMLPropString(node, "file"); break; @@ -23350,7 +23350,7 @@ virDomainDiskSourceFormat(virBuffer *buf, g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); =20 - switch ((virStorageType)src->type) { + switch (src->type) { case VIR_STORAGE_TYPE_FILE: virBufferEscapeString(&attrBuf, " file=3D'%s'", src->path); break; diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 38596fa4de..176c25cd11 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -182,7 +182,7 @@ qemuMigrationDstPrecreateDisk(virConnectPtr *conn, =20 VIR_DEBUG("Precreate disk type=3D%s", virStorageTypeToString(disk->src= ->type)); =20 - switch ((virStorageType)disk->src->type) { + switch (disk->src->type) { case VIR_STORAGE_TYPE_FILE: if (!virDomainDiskGetSource(disk)) { VIR_DEBUG("Dropping sourceless disk '%s'", --=20 2.35.1