|
|
c401cc |
From 8e7fd018619c0f4ff3a231e6bb133b282ae6dc04 Mon Sep 17 00:00:00 2001
|
|
|
c401cc |
Message-Id: <8e7fd018619c0f4ff3a231e6bb133b282ae6dc04@dist-git>
|
|
|
c401cc |
From: Eric Blake <eblake@redhat.com>
|
|
|
c401cc |
Date: Wed, 26 Feb 2014 14:54:38 +0100
|
|
|
c401cc |
Subject: [PATCH] storage: use correct type for array count
|
|
|
c401cc |
|
|
|
c401cc |
https://bugzilla.redhat.com/show_bug.cgi?id=1032370
|
|
|
c401cc |
|
|
|
c401cc |
Using size_t counts will let us use VIR_APPEND_ELEMENT and friends.
|
|
|
c401cc |
|
|
|
c401cc |
* src/conf/storage_conf.h (_virStoragePoolObjList)
|
|
|
c401cc |
(_virStorageVolDefList): Track list sizes with size_t.
|
|
|
c401cc |
* src/storage/storage_backend_rbd.c
|
|
|
c401cc |
(virStorageBackendRBDRefreshPool): Fix type fallout.
|
|
|
c401cc |
|
|
|
c401cc |
Signed-off-by: Eric Blake <eblake@redhat.com>
|
|
|
c401cc |
(cherry picked from commit 41183cf7bbf5c8ff57dc9d93ce3e79750024e06f)
|
|
|
c401cc |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
c401cc |
---
|
|
|
c401cc |
src/conf/storage_conf.h | 4 ++--
|
|
|
c401cc |
src/storage/storage_backend_rbd.c | 2 +-
|
|
|
c401cc |
2 files changed, 3 insertions(+), 3 deletions(-)
|
|
|
c401cc |
|
|
|
c401cc |
diff --git a/src/conf/storage_conf.h b/src/conf/storage_conf.h
|
|
|
c401cc |
index 644facc..f8a7eec 100644
|
|
|
c401cc |
--- a/src/conf/storage_conf.h
|
|
|
c401cc |
+++ b/src/conf/storage_conf.h
|
|
|
c401cc |
@@ -112,7 +112,7 @@ struct _virStorageVolDef {
|
|
|
c401cc |
typedef struct _virStorageVolDefList virStorageVolDefList;
|
|
|
c401cc |
typedef virStorageVolDefList *virStorageVolDefListPtr;
|
|
|
c401cc |
struct _virStorageVolDefList {
|
|
|
c401cc |
- unsigned int count;
|
|
|
c401cc |
+ size_t count;
|
|
|
c401cc |
virStorageVolDefPtr *objs;
|
|
|
c401cc |
};
|
|
|
c401cc |
|
|
|
c401cc |
@@ -342,7 +342,7 @@ struct _virStoragePoolObj {
|
|
|
c401cc |
typedef struct _virStoragePoolObjList virStoragePoolObjList;
|
|
|
c401cc |
typedef virStoragePoolObjList *virStoragePoolObjListPtr;
|
|
|
c401cc |
struct _virStoragePoolObjList {
|
|
|
c401cc |
- unsigned int count;
|
|
|
c401cc |
+ size_t count;
|
|
|
c401cc |
virStoragePoolObjPtr *objs;
|
|
|
c401cc |
};
|
|
|
c401cc |
|
|
|
c401cc |
diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
|
|
|
c401cc |
index 60b48c2..eae9a3c 100644
|
|
|
c401cc |
--- a/src/storage/storage_backend_rbd.c
|
|
|
c401cc |
+++ b/src/storage/storage_backend_rbd.c
|
|
|
c401cc |
@@ -381,7 +381,7 @@ static int virStorageBackendRBDRefreshPool(virConnectPtr conn,
|
|
|
c401cc |
pool->volumes.objs[pool->volumes.count++] = vol;
|
|
|
c401cc |
}
|
|
|
c401cc |
|
|
|
c401cc |
- VIR_DEBUG("Found %d images in RBD pool %s",
|
|
|
c401cc |
+ VIR_DEBUG("Found %zu images in RBD pool %s",
|
|
|
c401cc |
pool->volumes.count, pool->def->source.name);
|
|
|
c401cc |
|
|
|
c401cc |
ret = 0;
|
|
|
c401cc |
--
|
|
|
c401cc |
1.9.0
|
|
|
c401cc |
|