From nobody Mon Dec 15 03:05:06 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1503580176646133.1155511886427; Thu, 24 Aug 2017 06:09:36 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C69D781E19; Thu, 24 Aug 2017 13:09:34 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8D7587E661; Thu, 24 Aug 2017 13:09:34 +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 4889F1864DBB; Thu, 24 Aug 2017 13:09:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v7OD9G25027837 for ; Thu, 24 Aug 2017 09:09:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id F2FF57B606; Thu, 24 Aug 2017 13:09:15 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-123-165.rdu2.redhat.com [10.10.123.165]) by smtp.corp.redhat.com (Postfix) with ESMTP id C2BED7B8DE for ; Thu, 24 Aug 2017 13:09:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C69D781E19 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: John Ferlan To: libvir-list@redhat.com Date: Thu, 24 Aug 2017 09:09:03 -0400 Message-Id: <20170824130905.5199-11-jferlan@redhat.com> In-Reply-To: <20170824130905.5199-1-jferlan@redhat.com> References: <20170824130905.5199-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 10/12] storage: Internally represent @autostart to bool 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 24 Aug 2017 13:09:35 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Since it's been used that way anyway, let's just convert it to a bool and only make the external representation be an int. Signed-off-by: John Ferlan --- src/conf/virstorageobj.c | 4 ++-- src/conf/virstorageobj.h | 4 ++-- src/storage/storage_driver.c | 2 +- src/test/test_driver.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/conf/virstorageobj.c b/src/conf/virstorageobj.c index 8ee40e2..1364bdd 100644 --- a/src/conf/virstorageobj.c +++ b/src/conf/virstorageobj.c @@ -133,13 +133,13 @@ virStoragePoolObjIsAutostart(virStoragePoolObjPtr obj) if (!obj->configFile) return 0; =20 - return obj->autostart =3D=3D 1; + return obj->autostart; } =20 =20 void virStoragePoolObjSetAutostart(virStoragePoolObjPtr obj, - int autostart) + bool autostart) { obj->autostart =3D autostart; } diff --git a/src/conf/virstorageobj.h b/src/conf/virstorageobj.h index c2f3f23..b65b160 100644 --- a/src/conf/virstorageobj.h +++ b/src/conf/virstorageobj.h @@ -33,7 +33,7 @@ struct _virStoragePoolObj { char *configFile; char *autostartLink; bool active; - int autostart; + bool autostart; unsigned int asyncjobs; =20 virStoragePoolDefPtr def; @@ -108,7 +108,7 @@ virStoragePoolObjIsAutostart(virStoragePoolObjPtr obj); =20 void virStoragePoolObjSetAutostart(virStoragePoolObjPtr obj, - int autostart); + bool autostart); =20 unsigned int virStoragePoolObjGetAsyncjobs(virStoragePoolObjPtr obj); diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index c9156e6..6fae6f4 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -1310,7 +1310,7 @@ storagePoolSetAutostart(virStoragePoolPtr pool, goto cleanup; } } - virStoragePoolObjSetAutostart(obj, autostart); + virStoragePoolObjSetAutostart(obj, new_autostart); } =20 ret =3D 0; diff --git a/src/test/test_driver.c b/src/test/test_driver.c index b793187..69d61b5 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -4761,6 +4761,7 @@ testStoragePoolSetAutostart(virStoragePoolPtr pool, { testDriverPtr privconn =3D pool->conn->privateData; virStoragePoolObjPtr obj; + bool new_autostart =3D (autostart !=3D 0); int ret =3D -1; =20 if (!(obj =3D testStoragePoolObjFindByName(privconn, pool->name))) @@ -4772,8 +4773,7 @@ testStoragePoolSetAutostart(virStoragePoolPtr pool, goto cleanup; } =20 - autostart =3D (autostart !=3D 0); - virStoragePoolObjSetAutostart(obj, autostart); + virStoragePoolObjSetAutostart(obj, new_autostart); ret =3D 0; =20 cleanup: --=20 2.9.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list