From nobody Wed Nov 27 04:46:11 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1558708661; cv=none; d=zoho.com; s=zohoarc; b=FhOV6L4asnVJESOKHa4rFnC0uB7XFAT3pOsIXAJIZOWl5i6s3uFgKAD/NrsT66/ZVgKgT+xALclP2hIsj7u3yRSw8G9yVYt3JGkNmGCzQhd9xaDE4syJ4Kh4Bo23hGVFUnpDjWRL699dfKXQsspSSto2xwGxQywU1NTGAMIIxdE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558708661; 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:ARC-Authentication-Results; bh=0UvklhwyrIT84cjPrFrvAtC09C0cNfwDgQPGithWpCk=; b=OodMFcGjT+8nLqnpMlauXwAPMi5Vscmy6XdFkzq0Sx5qyAFRSZcJt+QINN1dp/0m6fqelmXqcbaT0wMLN0TBJf2G0ftnDrURFCXXBLNgrfU3ufesX/hbBcaNYCJ59Lh6P00hh1HFRsy7xq0qYqd+SiiHDlxWK9qG3kfQ3jGA4fg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 155870866121189.8165427309599; Fri, 24 May 2019 07:37:41 -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 02F6330198AA; Fri, 24 May 2019 14:37:33 +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 C50C436FB; Fri, 24 May 2019 14:37:32 +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 70AF81806B14; Fri, 24 May 2019 14:37:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x4OEa4OA011340 for ; Fri, 24 May 2019 10:36:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3F16B69287; Fri, 24 May 2019 14:36:04 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA74969294 for ; Fri, 24 May 2019 14:36:03 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Fri, 24 May 2019 16:35:41 +0200 Message-Id: <2e4784d01752dbf888187924a6f18e74f7c8b8f1.1558707820.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v1 05/11] virstorageobj: Rename virStoragePoolObjAssignDef 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: , 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.47]); Fri, 24 May 2019 14:37:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This function is doing much more than plain assigning pool definition to a pool object. Rename it. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/conf/virstorageobj.c | 12 ++++++------ src/conf/virstorageobj.h | 6 +++--- src/libvirt_private.syms | 2 +- src/storage/storage_driver.c | 4 ++-- src/test/test_driver.c | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/conf/virstorageobj.c b/src/conf/virstorageobj.c index 286f55fb0c..7f25931d05 100644 --- a/src/conf/virstorageobj.c +++ b/src/conf/virstorageobj.c @@ -1506,7 +1506,7 @@ virStoragePoolObjSourceFindDuplicate(virStoragePoolOb= jListPtr pools, =20 =20 /** - * virStoragePoolObjAssignDef: + * virStoragePoolObjListAdd: * @pools: Storage Pool object list pointer * @def: Storage pool definition to add or update * @check_active: If true, ensure that pool is not active @@ -1517,9 +1517,9 @@ virStoragePoolObjSourceFindDuplicate(virStoragePoolOb= jListPtr pools, * Returns locked and reffed object pointer or NULL on error */ virStoragePoolObjPtr -virStoragePoolObjAssignDef(virStoragePoolObjListPtr pools, - virStoragePoolDefPtr def, - bool check_active) +virStoragePoolObjListAdd(virStoragePoolObjListPtr pools, + virStoragePoolDefPtr def, + bool check_active) { virStoragePoolObjPtr obj =3D NULL; char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -1590,7 +1590,7 @@ virStoragePoolObjLoad(virStoragePoolObjListPtr pools, return NULL; } =20 - if (!(obj =3D virStoragePoolObjAssignDef(pools, def, false))) + if (!(obj =3D virStoragePoolObjListAdd(pools, def, false))) return NULL; def =3D NULL; =20 @@ -1651,7 +1651,7 @@ virStoragePoolObjLoadState(virStoragePoolObjListPtr p= ools, } =20 /* create the object */ - if (!(obj =3D virStoragePoolObjAssignDef(pools, def, true))) + if (!(obj =3D virStoragePoolObjListAdd(pools, def, true))) goto cleanup; def =3D NULL; =20 diff --git a/src/conf/virstorageobj.h b/src/conf/virstorageobj.h index c41d4c16ad..090dd6a7e6 100644 --- a/src/conf/virstorageobj.h +++ b/src/conf/virstorageobj.h @@ -193,9 +193,9 @@ virStoragePoolObjVolumeListExport(virConnectPtr conn, virStoragePoolVolumeACLFilter filter); =20 virStoragePoolObjPtr -virStoragePoolObjAssignDef(virStoragePoolObjListPtr pools, - virStoragePoolDefPtr def, - bool check_active); +virStoragePoolObjListAdd(virStoragePoolObjListPtr pools, + virStoragePoolDefPtr def, + bool check_active); =20 int virStoragePoolObjSaveDef(virStorageDriverStatePtr driver, diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 909975750c..8fb366d218 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1178,7 +1178,6 @@ virSecretObjSetValueSize; =20 # conf/virstorageobj.h virStoragePoolObjAddVol; -virStoragePoolObjAssignDef; virStoragePoolObjClearVols; virStoragePoolObjDecrAsyncjobs; virStoragePoolObjDefUseNewDef; @@ -1197,6 +1196,7 @@ virStoragePoolObjGetVolumesCount; virStoragePoolObjIncrAsyncjobs; virStoragePoolObjIsActive; virStoragePoolObjIsAutostart; +virStoragePoolObjListAdd; virStoragePoolObjListExport; virStoragePoolObjListForEach; virStoragePoolObjListNew; diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 5d3ab1b25f..b4a56e54bb 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -743,7 +743,7 @@ storagePoolCreateXML(virConnectPtr conn, if ((backend =3D virStorageBackendForType(newDef->type)) =3D=3D NULL) goto cleanup; =20 - if (!(obj =3D virStoragePoolObjAssignDef(driver->pools, newDef, true))) + if (!(obj =3D virStoragePoolObjListAdd(driver->pools, newDef, true))) goto cleanup; newDef =3D NULL; def =3D virStoragePoolObjGetDef(obj); @@ -818,7 +818,7 @@ storagePoolDefineXML(virConnectPtr conn, if (virStorageBackendForType(newDef->type) =3D=3D NULL) goto cleanup; =20 - if (!(obj =3D virStoragePoolObjAssignDef(driver->pools, newDef, false)= )) + if (!(obj =3D virStoragePoolObjListAdd(driver->pools, newDef, false))) goto cleanup; newDef =3D virStoragePoolObjGetNewDef(obj); def =3D virStoragePoolObjGetDef(obj); diff --git a/src/test/test_driver.c b/src/test/test_driver.c index a0f19f5c5c..832943c1fb 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -1095,7 +1095,7 @@ testParseStorage(testDriverPtr privconn, if (!def) return -1; =20 - if (!(obj =3D virStoragePoolObjAssignDef(privconn->pools, def, fal= se))) { + if (!(obj =3D virStoragePoolObjListAdd(privconn->pools, def, false= ))) { virStoragePoolDefFree(def); return -1; } @@ -4581,7 +4581,7 @@ testStoragePoolCreateXML(virConnectPtr conn, if (!(newDef =3D virStoragePoolDefParseString(xml))) goto cleanup; =20 - if (!(obj =3D virStoragePoolObjAssignDef(privconn->pools, newDef, true= ))) + if (!(obj =3D virStoragePoolObjListAdd(privconn->pools, newDef, true))) goto cleanup; newDef =3D NULL; def =3D virStoragePoolObjGetDef(obj); @@ -4647,7 +4647,7 @@ testStoragePoolDefineXML(virConnectPtr conn, newDef->allocation =3D defaultPoolAlloc; newDef->available =3D defaultPoolCap - defaultPoolAlloc; =20 - if (!(obj =3D virStoragePoolObjAssignDef(privconn->pools, newDef, fals= e))) + if (!(obj =3D virStoragePoolObjListAdd(privconn->pools, newDef, false)= )) goto cleanup; newDef =3D NULL; def =3D virStoragePoolObjGetDef(obj); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list