From nobody Mon Feb 9 00:30:35 2026 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1524662774688984.5803983799825; Wed, 25 Apr 2018 06:26:14 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ACFC1804EF; Wed, 25 Apr 2018 13:26: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 371A93141D19; Wed, 25 Apr 2018 13:26: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 1DB904CAA9; Wed, 25 Apr 2018 13:26:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3PDPDAk002235 for ; Wed, 25 Apr 2018 09:25:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8CFAB2166BC6; Wed, 25 Apr 2018 13:25:13 +0000 (UTC) Received: from caroline.localdomain (unknown [10.43.2.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D3FF2215CDCB for ; Wed, 25 Apr 2018 13:25:12 +0000 (UTC) Received: from caroline.brq.redhat.com (caroline.usersys.redhat.com [127.0.0.1]) by caroline.localdomain (Postfix) with ESMTP id 9AEF512007D for ; Wed, 25 Apr 2018 15:25:09 +0200 (CEST) From: Martin Kletzander To: libvir-list@redhat.com Date: Wed, 25 Apr 2018 15:24:55 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 18/30] storage/: Remove spaces after casts 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.84 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 25 Apr 2018 13:26:13 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Martin Kletzander Reviewed-by: J=EF=BF=BDn Tomko --- src/storage/storage_backend_fs.c | 2 +- src/storage/storage_backend_gluster.c | 6 ++-- src/storage/storage_backend_logical.c | 2 +- src/storage/storage_backend_vstorage.c | 6 ++-- src/storage/storage_driver.c | 6 ++-- src/storage/storage_util.c | 44 +++++++++++++------------- 6 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend= _fs.c index 9b0fcf92c5cd..e10c497bf201 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -798,7 +798,7 @@ virStorageFileBackendFileRead(virStorageSourcePtr src, } =20 if (offset > 0) { - if (lseek(fd, offset, SEEK_SET) =3D=3D (off_t) -1) { + if (lseek(fd, offset, SEEK_SET) =3D=3D (off_t)-1) { virReportSystemError(errno, _("cannot seek into '%s'"), src->p= ath); goto cleanup; } diff --git a/src/storage/storage_backend_gluster.c b/src/storage/storage_ba= ckend_gluster.c index c6cc531e2ff6..fe29e026add8 100644 --- a/src/storage/storage_backend_gluster.c +++ b/src/storage/storage_backend_gluster.c @@ -350,7 +350,7 @@ virStorageBackendGlusterRefreshPool(virStoragePoolObjPt= r pool) struct { struct dirent ent; /* See comment below about readdir_r needing padding */ - char padding[MAX(1, 256 - (int) (sizeof(struct dirent) + char padding[MAX(1, 256 - (int)(sizeof(struct dirent) - offsetof(struct dirent, d_name)= ))]; } de; struct dirent *ent; @@ -431,7 +431,7 @@ virStorageBackendGlusterVolDelete(virStoragePoolObjPtr = pool, =20 virCheckFlags(0, -1); =20 - switch ((virStorageVolType) vol->type) { + switch ((virStorageVolType)vol->type) { case VIR_STORAGE_VOL_FILE: case VIR_STORAGE_VOL_DIR: case VIR_STORAGE_VOL_BLOCK: @@ -731,7 +731,7 @@ virStorageFileBackendGlusterRead(virStorageSourcePtr sr= c, } =20 if (offset > 0) { - if (glfs_lseek(fd, offset, SEEK_SET) =3D=3D (off_t) -1) { + if (glfs_lseek(fd, offset, SEEK_SET) =3D=3D (off_t)-1) { virReportSystemError(errno, _("cannot seek into '%s'"), src->p= ath); goto cleanup; } diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_ba= ckend_logical.c index 6a7d59bd57e0..edd4971f1f1f 100644 --- a/src/storage/storage_backend_logical.c +++ b/src/storage/storage_backend_logical.c @@ -1005,7 +1005,7 @@ virStorageBackendLogicalCreateVol(virStoragePoolObjPt= r pool, goto error; } } - if (fchmod(fd, (vol->target.perms->mode =3D=3D (mode_t) -1 ? + if (fchmod(fd, (vol->target.perms->mode =3D=3D (mode_t)-1 ? VIR_STORAGE_DEFAULT_VOL_PERM_MODE : vol->target.perms->mode)) < 0) { virReportSystemError(errno, diff --git a/src/storage/storage_backend_vstorage.c b/src/storage/storage_b= ackend_vstorage.c index 076617aeb634..fcaebf29e7c6 100644 --- a/src/storage/storage_backend_vstorage.c +++ b/src/storage/storage_backend_vstorage.c @@ -45,11 +45,11 @@ virStorageBackendVzPoolStart(virStoragePoolObjPtr pool) char *mode =3D NULL; =20 /* Check the permissions */ - if (def->target.perms.mode =3D=3D (mode_t) - 1) + if (def->target.perms.mode =3D=3D (mode_t)- 1) def->target.perms.mode =3D VIR_STORAGE_DEFAULT_POOL_PERM_MODE; - if (def->target.perms.uid =3D=3D (uid_t) -1) + if (def->target.perms.uid =3D=3D (uid_t)-1) def->target.perms.uid =3D geteuid(); - if (def->target.perms.gid =3D=3D (gid_t) -1) + if (def->target.perms.gid =3D=3D (gid_t)-1) def->target.perms.gid =3D getegid(); =20 /* Convert ids to names because vstorage uses names */ diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 610427673076..b125e2caf916 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -1513,7 +1513,7 @@ static bool storageVolLookupByKeyCallback(virStoragePoolObjPtr obj, const void *opaque) { - struct storageVolLookupData *data =3D (struct storageVolLookupData *) = opaque; + struct storageVolLookupData *data =3D (struct storageVolLookupData *)o= paque; =20 if (virStoragePoolObjIsActive(obj)) data->voldef =3D virStorageVolDefFindByKey(obj, data->key); @@ -1556,7 +1556,7 @@ static bool storageVolLookupByPathCallback(virStoragePoolObjPtr obj, const void *opaque) { - struct storageVolLookupData *data =3D (struct storageVolLookupData *) = opaque; + struct storageVolLookupData *data =3D (struct storageVolLookupData *)o= paque; virStoragePoolDefPtr def; char *stable_path =3D NULL; =20 @@ -1565,7 +1565,7 @@ storageVolLookupByPathCallback(virStoragePoolObjPtr o= bj, =20 def =3D virStoragePoolObjGetDef(obj); =20 - switch ((virStoragePoolType) def->type) { + switch ((virStoragePoolType)def->type) { case VIR_STORAGE_POOL_DIR: case VIR_STORAGE_POOL_FS: case VIR_STORAGE_POOL_NETFS: diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index 897dfdaaee4d..03f03b407e13 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -271,19 +271,19 @@ storageBackendCreateBlockFrom(virStoragePoolObjPtr po= ol ATTRIBUTE_UNUSED, goto cleanup; } uid =3D (vol->target.perms->uid !=3D st.st_uid) ? vol->target.perms->u= id - : (uid_t) -1; + : (uid_t)-1; gid =3D (vol->target.perms->gid !=3D st.st_gid) ? vol->target.perms->g= id - : (gid_t) -1; - if (((uid !=3D (uid_t) -1) || (gid !=3D (gid_t) -1)) + : (gid_t)-1; + if (((uid !=3D (uid_t)-1) || (gid !=3D (gid_t)-1)) && (fchown(fd, uid, gid) < 0)) { virReportSystemError(errno, _("cannot chown '%s' to (%u, %u)"), - vol->target.path, (unsigned int) uid, - (unsigned int) gid); + vol->target.path, (unsigned int)uid, + (unsigned int)gid); goto cleanup; } =20 - mode =3D (vol->target.perms->mode =3D=3D (mode_t) -1 ? + mode =3D (vol->target.perms->mode =3D=3D (mode_t)-1 ? VIR_STORAGE_DEFAULT_VOL_PERM_MODE : vol->target.perms->mode); if (fchmod(fd, mode) < 0) { virReportSystemError(errno, @@ -433,7 +433,7 @@ storageBackendCreateRaw(virStoragePoolObjPtr pool, if (def->type =3D=3D VIR_STORAGE_POOL_NETFS) operation_flags |=3D VIR_FILE_OPEN_FORK; =20 - if (vol->target.perms->mode !=3D (mode_t) -1) + if (vol->target.perms->mode !=3D (mode_t)-1) open_mode =3D vol->target.perms->mode; =20 if ((fd =3D virFileOpenAs(vol->target.path, @@ -595,7 +595,7 @@ virStorageBackendCreateExecCommand(virStoragePoolObjPtr= pool, struct stat st; gid_t gid; uid_t uid; - mode_t mode =3D (vol->target.perms->mode =3D=3D (mode_t) -1 ? + mode_t mode =3D (vol->target.perms->mode =3D=3D (mode_t)-1 ? VIR_STORAGE_DEFAULT_VOL_PERM_MODE : vol->target.perms->mode); bool filecreated =3D false; @@ -603,9 +603,9 @@ virStorageBackendCreateExecCommand(virStoragePoolObjPtr= pool, =20 if ((def->type =3D=3D VIR_STORAGE_POOL_NETFS) && (((geteuid() =3D=3D 0) - && (vol->target.perms->uid !=3D (uid_t) -1) + && (vol->target.perms->uid !=3D (uid_t)-1) && (vol->target.perms->uid !=3D 0)) - || ((vol->target.perms->gid !=3D (gid_t) -1) + || ((vol->target.perms->gid !=3D (gid_t)-1) && (vol->target.perms->gid !=3D getegid())))) { =20 virCommandSetUID(cmd, vol->target.perms->uid); @@ -656,15 +656,15 @@ virStorageBackendCreateExecCommand(virStoragePoolObjP= tr pool, } =20 uid =3D (vol->target.perms->uid !=3D st.st_uid) ? vol->target.perms->u= id - : (uid_t) -1; + : (uid_t)-1; gid =3D (vol->target.perms->gid !=3D st.st_gid) ? vol->target.perms->g= id - : (gid_t) -1; - if (((uid !=3D (uid_t) -1) || (gid !=3D (gid_t) -1)) + : (gid_t)-1; + if (((uid !=3D (uid_t)-1) || (gid !=3D (gid_t)-1)) && (chown(vol->target.path, uid, gid) < 0)) { virReportSystemError(errno, _("cannot chown %s to (%u, %u)"), - vol->target.path, (unsigned int) uid, - (unsigned int) gid); + vol->target.path, (unsigned int)uid, + (unsigned int)gid); goto cleanup; } =20 @@ -730,7 +730,7 @@ storageBackendCreatePloop(virStoragePoolObjPtr pool ATT= RIBUTE_UNUSED, =20 if (!inputvol) { if ((virDirCreate(vol->target.path, - (vol->target.perms->mode =3D=3D (mode_t) -1 ? + (vol->target.perms->mode =3D=3D (mode_t)-1 ? VIR_STORAGE_DEFAULT_VOL_PERM_MODE: vol->target.perms->mode), vol->target.perms->uid, @@ -1354,8 +1354,8 @@ storageBackendCreateQemuImgSecretPath(virStoragePoolO= bjPtr pool, } VIR_FORCE_CLOSE(fd); =20 - if ((vol->target.perms->uid !=3D (uid_t) -1) && - (vol->target.perms->gid !=3D (gid_t) -1)) { + if ((vol->target.perms->uid !=3D (uid_t)-1) && + (vol->target.perms->gid !=3D (gid_t)-1)) { if (chown(secretPath, vol->target.perms->uid, vol->target.perms->gid) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -2105,7 +2105,7 @@ createFileDir(virStoragePoolObjPtr pool, =20 =20 if ((err =3D virDirCreate(vol->target.path, - (vol->target.perms->mode =3D=3D (mode_t) -1 ? + (vol->target.perms->mode =3D=3D (mode_t)-1 ? VIR_STORAGE_DEFAULT_VOL_PERM_MODE : vol->target.perms->mode), vol->target.perms->uid, @@ -2236,7 +2236,7 @@ virStorageBackendVolDeleteLocal(virStoragePoolObjPtr = pool ATTRIBUTE_UNUSED, { virCheckFlags(0, -1); =20 - switch ((virStorageVolType) vol->type) { + switch ((virStorageVolType)vol->type) { case VIR_STORAGE_VOL_FILE: case VIR_STORAGE_VOL_DIR: if (virFileRemove(vol->target.path, vol->target.perms->uid, @@ -2660,7 +2660,7 @@ storageBackendWipeLocal(const char *path, } } =20 - VIR_DEBUG("wiping start: %zd len: %llu", (ssize_t) size, wipe_len); + VIR_DEBUG("wiping start: %zd len: %llu", (ssize_t)size, wipe_len); =20 remaining =3D wipe_len; while (remaining > 0) { @@ -2912,7 +2912,7 @@ virStorageBackendBuildLocal(virStoragePoolObjPtr pool) needs_create_as_uid =3D (def->type =3D=3D VIR_STORAGE_POOL_NETFS); mode =3D def->target.perms.mode; =20 - if (mode =3D=3D (mode_t) -1 && + if (mode =3D=3D (mode_t)-1 && (needs_create_as_uid || !virFileExists(def->target.path))) mode =3D VIR_STORAGE_DEFAULT_POOL_PERM_MODE; if (needs_create_as_uid) --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list