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) {
--
Libvir-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to