[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[libvirt] [PATCH] Fix capacity reporting for qcow2 images
- From: Cole Robinson <crobinso redhat com>
- To: libvir-list redhat com
- Subject: [libvirt] [PATCH] Fix capacity reporting for qcow2 images
- Date: Tue, 02 Sep 2008 17:17:56 -0400
Libvirt was reporting some ridiculously large 'capacity'
values for some qcow2 images I was creating with relatively
small sizes (200 MB). Seems there was a signedness problem
when parsing the file header. The attached fix shows the
expected values and doesn't look like it will hurt elsewhere.
Thanks,
Cole
diff --git a/src/storage_backend_fs.c b/src/storage_backend_fs.c
index 36bfac4..7042b69 100644
--- a/src/storage_backend_fs.c
+++ b/src/storage_backend_fs.c
@@ -333,7 +333,7 @@ virStorageBackendFileSystemNetPoolFormatToString(virConnectPtr conn,
static int virStorageBackendProbeFile(virConnectPtr conn,
virStorageVolDefPtr def) {
int fd;
- char head[4096];
+ unsigned char head[4096];
int len, i, ret;
if ((fd = open(def->target.path, O_RDONLY)) < 0) {
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]