Displaying 14 results from an estimated 14 matches for "scnd32".
2015 Oct 16
4
[PATCH 0/2] Introduce get_min_size API to get minimum filesystem size.
Tried to make it in accordance with your comments.
Maybe you can suggest a better name for API?
Maxim Perevedentsev (2):
New API: get_min_size
Include resize2fs_P into get_min_size.
daemon/Makefile.am | 1 +
daemon/daemon.h | 2 ++
daemon/ext2.c | 37 ++++++++++++++++++++++++----
daemon/fs-min-size.c | 49 +++++++++++++++++++++++++++++++++++++
daemon/ntfs.c | 68
2015 Oct 19
5
[PATCHv2 0/2] Introduce vfs_min_size API to get minimum filesystem size.
Tried to make it in accordance with your comments.
Difference to v1:
Added reply_with_error where necessary.
Changed name get_min_size -> vfs_min_size.
Maxim Perevedentsev (2):
New API: vfs_min_size
Include resize2fs_P into vfs_min_size.
daemon/Makefile.am | 1 +
daemon/daemon.h | 2 ++
daemon/ext2.c | 45 ++++++++++++++++++++++++++-----
daemon/fs-min-size.c | 49
2015 Oct 16
0
[PATCH 2/2] Include resize2fs_P into get_min_size.
...har *block_pattern = "Block size";
+ size_t i;
+ int32_t block_size;
+
+ params = do_tune2fs_l (device);
+ if (params == NULL)
+ return -1;
+
+ for (i = 0; params[i] != NULL; i += 2) {
+ if ((!strcmp (params[i], block_pattern))) {
+ if (sscanf (params[i + 1], "%" SCNd32, &block_size) != 1)
+ return -1;
+ return block_size;
+ }
+ }
+
+ return -1;
+}
+
int64_t
-do_resize2fs_P (const char *device)
+ext_get_min_size (const char *device)
{
CLEANUP_FREE char *err = NULL, *out = NULL;
CLEANUP_FREE_STRING_LIST char **lines = NULL;
@@ -288,6 +3...
2015 Oct 19
0
[PATCH 2/2] Include resize2fs_P into vfs_min_size.
...har *block_pattern = "Block size";
+ size_t i;
+ int32_t block_size;
+
+ params = do_tune2fs_l (device);
+ if (params == NULL)
+ return -1;
+
+ for (i = 0; params[i] != NULL; i += 2) {
+ if ((!strcmp (params[i], block_pattern))) {
+ if (sscanf (params[i + 1], "%" SCNd32, &block_size) != 1) {
+ reply_with_error("Cannot parse block size");
+ return -1;
+ }
+ return block_size;
+ }
+ }
+
+ reply_with_error("No block size in tune2fs_l output. Check format.")
+ return -1;
+}
+
int64_t
-do_resize2fs_P (const char *d...
2015 Oct 19
1
Re: [PATCH 2/2] Include resize2fs_P into vfs_min_size.
...params == NULL)
> + return -1;
> +
> + for (i = 0; params[i] != NULL; i += 2) {
> + if ((!strcmp (params[i], block_pattern))) {
Please use STREQ, like use everywhere else in libguestfs.
(and the extra brackets are not needed)
> + if (sscanf (params[i + 1], "%" SCNd32, &block_size) != 1) {
> + reply_with_error("Cannot parse block size");
This could use a simplier xstrtoul/xstrtoull.
> + return -1;
> + }
> + return block_size;
> + }
> + }
> +
> + reply_with_error("No block size in tune2fs_l...
2015 Oct 19
5
Re: [PATCH 1/2] New API: vfs_min_size
...ines[i], full_pattern))
Better use STRPREFIX here, which is what we use all around libguestfs.
> + is_full = 1;
> + else if ((p = strstr (lines[i], cluster_size_pattern))) {
> + if (sscanf (p + strlen(cluster_size_pattern),
> + "%*[ ]:%" SCNd32, &cluster_size) != 1) {
> + reply_with_error("Cannot parse cluster size");
> + return -1;
> + }
> + }
> + else if ((p = strstr (lines[i], volume_size_pattern))) {
> + if (sscanf (p + strlen(volume_size_pattern),
> +...
2015 Oct 20
0
Re: [PATCH 1/2] New API: vfs_min_size
...is what we use all around libguestfs.
This is not at the beginning of line.
>
>> + is_full = 1;
>> + else if ((p = strstr (lines[i], cluster_size_pattern))) {
>> + if (sscanf (p + strlen(cluster_size_pattern),
>> + "%*[ ]:%" SCNd32, &cluster_size) != 1) {
>> + reply_with_error("Cannot parse cluster size");
>> + return -1;
>> + }
>> + }
>> + else if ((p = strstr (lines[i], volume_size_pattern))) {
>> + if (sscanf (p + strlen(volume_size...
2015 Oct 20
4
[PATCHv3 0/2] Introduce vfs_min_size API to get minimum filesystem size.
Tried to make it in accordance with your comments.
Difference to v1:
Added reply_with_error where necessary.
Changed name get_min_size -> vfs_min_size.
Difference to v2:
Changed name to vfs_minimum_size.
Changed parsing to xstrtol + STR* macros where possible.
Maxim Perevedentsev (2):
New API: vfs_min_size
Include resize2fs_P into vfs_min_size.
daemon/Makefile.am | 1 +
2015 Oct 16
2
[PATCH] New API: ntfsresize_info
..., ntfsresize returns error. */
+ for (i = 0; lines[i] != NULL; ++i) {
+ if (strstr (lines[i], full_pattern))
+ is_full = 1;
+ else if ((p = strstr (lines[i], cluster_size_pattern))) {
+ if (sscanf (p + strlen(cluster_size_pattern),
+ "%*[ ]:%" SCNd32, &cluster_size) != 1)
+ return -1;
+ }
+ else if ((p = strstr (lines[i], volume_size_pattern))) {
+ if (sscanf (p + strlen(volume_size_pattern),
+ "%" SCNd64, &volume_size) != 1)
+ return -1;
+ }
+ }
+ if (is_full) {...
2015 Oct 16
0
[PATCH 1/2] New API: get_min_size
..., ntfsresize returns error. */
+ for (i = 0; lines[i] != NULL; ++i) {
+ if (strstr (lines[i], full_pattern))
+ is_full = 1;
+ else if ((p = strstr (lines[i], cluster_size_pattern))) {
+ if (sscanf (p + strlen(cluster_size_pattern),
+ "%*[ ]:%" SCNd32, &cluster_size) != 1)
+ return -1;
+ }
+ else if ((p = strstr (lines[i], volume_size_pattern))) {
+ if (sscanf (p + strlen(volume_size_pattern),
+ "%" SCNd64, &volume_size) != 1)
+ return -1;
+ }
+ }
+ if (is_full) {...
2015 Oct 19
0
[PATCH 1/2] New API: vfs_min_size
..., ntfsresize returns error. */
+ for (i = 0; lines[i] != NULL; ++i) {
+ if (strstr (lines[i], full_pattern))
+ is_full = 1;
+ else if ((p = strstr (lines[i], cluster_size_pattern))) {
+ if (sscanf (p + strlen(cluster_size_pattern),
+ "%*[ ]:%" SCNd32, &cluster_size) != 1) {
+ reply_with_error("Cannot parse cluster size");
+ return -1;
+ }
+ }
+ else if ((p = strstr (lines[i], volume_size_pattern))) {
+ if (sscanf (p + strlen(volume_size_pattern),
+ "%" SCNd64,...
2015 Oct 20
0
[PATCHv3 1/2] New API: vfs_min_size
...sresize returns error. */
+ for (i = 0; lines[i] != NULL; ++i) {
+ if (strstr (lines[i], full_pattern))
+ is_full = 1;
+ else if (STRPREFIX (lines[i], cluster_size_pattern)) {
+ if (sscanf (lines[i] + strlen (cluster_size_pattern),
+ "%*[ ]:%" SCNd32, &cluster_size) != 1) {
+ reply_with_error ("Cannot parse cluster size");
+ return -1;
+ }
+ }
+ else if (STRPREFIX (lines[i], volume_size_pattern)) {
+ if (XSTRTOD64 (lines[i] + strlen (volume_size_pattern),
+ NULL, 20,...
2015 Oct 20
0
[PATCHv4 1/2] New API: vfs_minimum_size
...sresize returns error. */
+ for (i = 0; lines[i] != NULL; ++i) {
+ if (strstr (lines[i], full_pattern))
+ is_full = 1;
+ else if (STRPREFIX (lines[i], cluster_size_pattern)) {
+ if (sscanf (lines[i] + strlen (cluster_size_pattern),
+ "%*[ ]:%" SCNd32, &cluster_size) != 1) {
+ reply_with_error ("cannot parse cluster size");
+ return -1;
+ }
+ }
+ else if (STRPREFIX (lines[i], volume_size_pattern)) {
+ if (XSTRTOD64 (lines[i] + strlen (volume_size_pattern),
+ NULL, 20,...
2015 Oct 20
8
[PATCHv4 0/2] Introduce vfs_minimum_size API to get minimum filesystem size.
Tried to make it in accordance with your comments.
Difference to v1:
Added reply_with_error where necessary.
Changed name get_min_size -> vfs_min_size.
Difference to v2:
Changed name to vfs_minimum_size.
Changed parsing to xstrtol + STR* macros where possible.
Difference to v3:
Decapitalize error messages.
Maxim Perevedentsev (2):
New API: vfs_minimum_size
Include resize2fs_P into