From nobody Tue Feb 10 03:45:07 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1617796162; cv=none; d=zohomail.com; s=zohoarc; b=TAJvfoo/qcmnBuUxxu+etnLAp8XL++tWhdy7l4ULyc7cdQY9WyA4/3emp8rprAPtTB1aPkQoQDXayMo1d3aVoUxIE2ypBvKNDxcTsawUZtzM3pnFbpM9WG665tCGzoTCLB1RGvnQx1LXRJq3ErYzO30Iv5CvVKjQyjTSK2dUTPQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617796162; 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=/bcXqZeDP5d4GGECUWsPTeX7A16nmM6SsYGyT0a/FZg=; b=g5SZBSe44ufIjjxqNU8+q9UcI/HaoayEi1cAnT52G2ubnlQ0JrYVYbS1QHIZ8Ft6Bv0wHuAphDd5ySMMOch4/Xre3SBV0pYyS/d3KwiswQvlHT4A22SfXEZEn0+WwuJwsJQXmjLuk7E7aHSMqrVlJrwdYAHnuFoOmLP5GPiuUiM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1617796162921859.65093303365; Wed, 7 Apr 2021 04:49:22 -0700 (PDT) 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-539-OjCGgvgaPgKc4ZWNKih72Q-1; Wed, 07 Apr 2021 07:49:19 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D87D3107ACF4; Wed, 7 Apr 2021 11:49:12 +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 AE5441037E8B; Wed, 7 Apr 2021 11:49:12 +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 734B955347; Wed, 7 Apr 2021 11:49:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 137BmuLs006836 for ; Wed, 7 Apr 2021 07:48:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id D1A3A60C5C; Wed, 7 Apr 2021 11:48:56 +0000 (UTC) Received: from work.redhat.com (ovpn-113-23.ams2.redhat.com [10.36.113.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2406F60854; Wed, 7 Apr 2021 11:48:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617796161; 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=/bcXqZeDP5d4GGECUWsPTeX7A16nmM6SsYGyT0a/FZg=; b=WxYxKd2U0OCfnSt2vsqXwv7q4FQdTwptlONl3MtwAGSC99/f2vcoWUuir9nOq/LOJM+wrI F5Iy9pDd7AzGcb37n9N4DPf/8ZXGikMZrZ6XkalOZp3gvsCTEEFTtR0SU6dzu1EWp4YrT+ DUilfNIl4r5Yv7/PdTps1uc1MmuUEJI= X-MC-Unique: OjCGgvgaPgKc4ZWNKih72Q-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 13/14] conf: Use virTristateXXX in virStoragePoolSourceDevice Date: Wed, 7 Apr 2021 13:48:40 +0200 Message-Id: <20210407114841.85009-14-twiederh@redhat.com> In-Reply-To: <20210407114841.85009-1-twiederh@redhat.com> References: <20210407114841.85009-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.84 on 10.5.11.22 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) Content-Type: text/plain; charset="utf-8" Note that the comment for virStoragePoolSourceDevice::part_separator was wr= ong. Signed-off-by: Tim Wiederhake --- src/conf/storage_conf.c | 7 ++++--- src/conf/storage_conf.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 310a062ee7..e92de7e6a3 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -617,14 +617,15 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt, =20 partsep =3D virXMLPropString(nodeset[i], "part_separator"); if (partsep) { - dev.part_separator =3D virTristateBoolTypeFromString(partsep); - if (dev.part_separator <=3D 0) { + int value =3D virTristateBoolTypeFromString(partsep); + if (value <=3D 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("invalid part_separator setting '%s'"), partsep); virStoragePoolSourceDeviceClear(&dev); goto cleanup; } + dev.part_separator =3D value; } =20 if (VIR_APPEND_ELEMENT(source->devices, source->ndevice, dev) < 0)= { @@ -1097,7 +1098,7 @@ virStoragePoolSourceFormat(virBufferPtr buf, virBufferEscapeString(buf, "devices[i].path); if (src->devices[i].part_separator !=3D - VIR_TRISTATE_SWITCH_ABSENT) { + VIR_TRISTATE_BOOL_ABSENT) { virBufferAsprintf(buf, " part_separator=3D'%s'", virTristateBoolTypeToString(src->devices= [i].part_separator)); } diff --git a/src/conf/storage_conf.h b/src/conf/storage_conf.h index 647eb847bf..8d417af7bb 100644 --- a/src/conf/storage_conf.h +++ b/src/conf/storage_conf.h @@ -168,7 +168,7 @@ struct _virStoragePoolSourceDevice { virStoragePoolSourceDeviceExtentPtr freeExtents; char *path; int format; /* Pool specific source format */ - int part_separator; /* enum virTristateSwitch */ + virTristateBool part_separator; =20 /* When the source device is a physical disk, * the geometry data is needed --=20 2.26.2