Displaying 20 results from an estimated 28 matches for "size_str".
2011 Nov 10
5
[PATCH v2] Add tune2fs command.
The changes since the previous patch:
- safe ADD_ARG macro for adding arguments to a fixed size stack array
- support for testing functions that return RHashtable, ie. tune2fs-l.
- add tests that set (tune2fs) and get (tune2fs-l) various parameters.
- only one 'intervalbetweenchecks' parameter (in seconds)
Rich.
2023 Oct 08
1
[libnbd PATCH 2/2] info: Show human sizes for block_size values
...>> if (first)
>> @@ -304,6 +301,21 @@ show_boolean (const char *name, bool cond)
>> ansi_restore (fp);
>> }
>>
>> +/* Used for displaying sizes in non-JSON output. */
>> +void show_size (const char *name, int64_t size)
>> +{
>> + char size_str[HUMAN_SIZE_LONGEST];
>> + bool human_size_flag = false;
>> +
>> + if (size > 0) {
>> + human_size (size_str, size, &human_size_flag);
>> + if (human_size_flag)
>> + fprintf (fp, "\t%s: %" PRId64 " (%s)\n", name, size, size_...
2023 Oct 06
2
[libnbd PATCH 0/2] Improve nbdinfo display of block constraints
Based on Laszlo's approval of my idea here:
https://listman.redhat.com/archives/libguestfs/2023-September/032661.html
but as I would like to resync human-size.h back to nbdkit, I'm
reluctant to apply patch 1 this until I get Rich's consent to
relicensing (this email serves as my consent for my contribution here):
https://listman.redhat.com/archives/libguestfs/2023-October/032755.html
2014 Jan 27
0
[PATCH INCOMPLETE] Rewrite virt-make-fs in C (originally Perl).
...tfs.h"
+#include "guestfs-internal-frontend.h"
+
+#include "xstrtol.h"
+
+#include "options.h"
+
+guestfs_h *g;
+const char *libvirt_uri;
+int live;
+int read_only;
+int verbose;
+
+static const char *format = "raw", *label = NULL,
+ *partition = NULL, *size_str = NULL, *type = "ext2";
+
+enum { HELP_OPTION = CHAR_MAX + 1 };
+static const char *options = "F:s:t:Vvx";
+static const struct option long_options[] = {
+ { "debug", 0, 0, 'v' }, /* for compat with Perl tool */
+ { "floppy", 0, 0, 0 },
+ { "f...
2014 Jan 27
2
[PATCH INCOMPLETE] Rewrite virt-make-fs in C (originally Perl).
I thought it would be easy to rewrite virt-make-fs in C.
Two days later ...
The Perl program uses a lot of external commands, which makes
it pretty tedious to implement in C.
Rich.
2020 Feb 19
2
[PATCH 0/1] virt-make-fs: add '--blocksize' option support
From: Nikolay Ivanets <stenavin@gmail.com>
This patch adds 4096 bytes sector size for output disk.
Side notes:
While working on this patch I reveal long standing issue: virt-make-fs can fail
if source directory/archive contains certain amount of really small or empty
files or wide tree of directories. That is because of lack of available inodes
on a small file system to keep files
2020 Feb 19
0
[PATCH 1/1] virt-make-fs: add '--blocksize' option support
...d, 40 insertions(+), 3 deletions(-)
diff --git a/make-fs/make-fs.c b/make-fs/make-fs.c
index 5d8c3a385..81d1cf90b 100644
--- a/make-fs/make-fs.c
+++ b/make-fs/make-fs.c
@@ -54,10 +54,12 @@ int in_virt_rescue = 0;
static const char *format = "raw", *label = NULL,
*partition = NULL, *size_str = NULL, *type = "ext2";
+int blocksize = 0;
enum { HELP_OPTION = CHAR_MAX + 1 };
static const char options[] = "F:s:t:Vvx";
static const struct option long_options[] = {
+ { "blocksize", 1, 0, 0 },
{ "debug", 0, 0, 'v' }, /* for compat with P...
2014 Dec 12
15
[PATCH v3 00/11] btrfs support part2: qgroup/quota commands
Hi,
This is v3 series to add support to btrfs qgroup related commands, inclduing
quota commands, and two leftover of subvolume commands.
Regards,
Hu
changes:
v3:
- don't intialize fs_buf (patch 1)
- check the return value of sysroot_path (patch 1)
- check fs_buf rather than fs (patch 1)
- fprintf (stderr,...) -> reply_with_error()
v2:
- add tests for new APIs
- combine
2020 Feb 24
1
[PATCH v2] virt-make-fs: add '--blocksize' option support
...d, 42 insertions(+), 3 deletions(-)
diff --git a/make-fs/make-fs.c b/make-fs/make-fs.c
index 5d8c3a385..8027b6419 100644
--- a/make-fs/make-fs.c
+++ b/make-fs/make-fs.c
@@ -54,10 +54,12 @@ int in_virt_rescue = 0;
static const char *format = "raw", *label = NULL,
*partition = NULL, *size_str = NULL, *type = "ext2";
+static int blocksize = 0;
enum { HELP_OPTION = CHAR_MAX + 1 };
static const char options[] = "F:s:t:Vvx";
static const struct option long_options[] = {
+ { "blocksize", 1, 0, 0 },
{ "debug", 0, 0, 'v' }, /* for compat...
2014 Dec 11
14
[PATCH v2 00/11] btrfs support part2: qgroup/quota commands
Hi,
This is v2 series to add support to btrfs qgroup related commands, inclduing
quota commands, and two leftover of subvolume commands.
Regards,
Hu
changes:
v2:
- add tests for new APIs
- combine btrfs_quota_enable and btrfs_quota_disable
- following APIs changed to operate on Mountable_or_Path:
btrfs_subvolume_get_default, btrfs_quota_enable, btrfs_quota_rescan.
Hu Tao (11):
2015 Jun 16
1
[PATCH] btrfs: remove unused 'out' variables
...-1) {
reply_with_error ("%s: %s", fs_buf, err);
goto error;
@@ -1118,7 +1116,6 @@ do_btrfs_qgroup_limit (const char *subvolume, int64_t size)
size_t i = 0;
CLEANUP_FREE char *subvolume_buf = NULL;
CLEANUP_FREE char *err = NULL;
- CLEANUP_FREE char *out = NULL;
char size_str[32];
int r;
@@ -1136,7 +1133,7 @@ do_btrfs_qgroup_limit (const char *subvolume, int64_t size)
ADD_ARG (argv, i, subvolume_buf);
ADD_ARG (argv, i, NULL);
- r = commandv (&out, &err, argv);
+ r = commandv (NULL, &err, argv);
if (r == -1) {
reply_with_error ("%s...
2016 Jul 22
1
[PATCH] static const char *str -> static const char str
...1, 0, 'a' },
{ "connect", 1, 0, 'c' },
diff --git a/make-fs/make-fs.c b/make-fs/make-fs.c
index 8ece991..2f91370 100644
--- a/make-fs/make-fs.c
+++ b/make-fs/make-fs.c
@@ -51,7 +51,7 @@ static const char *format = "raw", *label = NULL,
*partition = NULL, *size_str = NULL, *type = "ext2";
enum { HELP_OPTION = CHAR_MAX + 1 };
-static const char *options = "F:s:t:Vvx";
+static const char options[] = "F:s:t:Vvx";
static const struct option long_options[] = {
{ "debug", 0, 0, 'v' }, /* for compat with Perl to...
2012 Feb 01
1
[PATCH] Clarify the error message when unavailable functions are called (RHBZ#679737).
...+ * Copyright (C) 2011-2012 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -47,6 +47,8 @@ do_btrfs_filesystem_resize (const char *filesystem, int64_t size)
size_t i = 0;
char size_str[32];
+ IF_NOT_AVAILABLE_ERROR (btrfs, -1);
+
ADD_ARG (argv, i, "btrfs");
ADD_ARG (argv, i, "filesystem");
ADD_ARG (argv, i, "resize");
diff --git a/daemon/daemon.h b/daemon/daemon.h
index babe5bc..051317f 100644
--- a/daemon/daemon.h
+++ b/daemon/daemon.h
@...
2017 Jul 27
0
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
...command (NULL, &err, "btrfs", "filesystem", "label",
device, label, NULL);
if (r == -1) {
reply_with_error ("%s", err);
@@ -110,7 +103,7 @@ do_btrfs_filesystem_resize (const char *filesystem, int64_t size)
size_t i = 0;
char size_str[32];
- ADD_ARG (argv, i, str_btrfs);
+ ADD_ARG (argv, i, "btrfs");
ADD_ARG (argv, i, "filesystem");
ADD_ARG (argv, i, "resize");
@@ -169,7 +162,7 @@ do_mkfs_btrfs (char *const *devices,
return -1;
}
- ADD_ARG (argv, i, str_mkfs_btrfs);
+ ADD_ARG...
2017 Jul 24
0
[PATCH 2/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
...command (NULL, &err, "btrfs", "filesystem", "label",
device, label, NULL);
if (r == -1) {
reply_with_error ("%s", err);
@@ -110,7 +106,7 @@ do_btrfs_filesystem_resize (const char *filesystem, int64_t size)
size_t i = 0;
char size_str[32];
- ADD_ARG (argv, i, str_btrfs);
+ ADD_ARG (argv, i, "btrfs");
ADD_ARG (argv, i, "filesystem");
ADD_ARG (argv, i, "resize");
@@ -169,7 +165,7 @@ do_mkfs_btrfs (char *const *devices,
return -1;
}
- ADD_ARG (argv, i, str_mkfs_btrfs);
+ ADD_ARG...
2012 Oct 08
3
[PATCH v3 0/3] Add support for disk labels and hotplugging.
This is, I guess, version 3 of this patch series which adds disk
labels and hotplugging (only hot-add implemented so far).
The good news is .. it works!
Rich.
2014 Jan 28
11
[PATCH 00/10] New API: disk-create for creating blank disks.
A lot of code runs 'qemu-img create' or 'truncate' to create blank
disk images.
In the past I resisted adding an API to do this, since it essentially
duplicates what you can already do using other tools (ie. qemu-img).
However this does simplify calling code quite a lot since qemu-img is
somewhat error-prone to use (eg: don't try to create a disk called
"foo:bar")
2012 Aug 30
2
[PATCH v2] daemon: collect list of called external commands
...lable ("btrfs") > 0;
+ return prog_exists (str_btrfs) && filesystem_available ("btrfs") > 0;
}
/* Takes optional arguments, consult optargs_bitmask. */
@@ -46,7 +51,7 @@ do_btrfs_filesystem_resize (const char *filesystem, int64_t size)
size_t i = 0;
char size_str[32];
- ADD_ARG (argv, i, "btrfs");
+ ADD_ARG (argv, i, str_btrfs);
ADD_ARG (argv, i, "filesystem");
ADD_ARG (argv, i, "resize");
@@ -109,7 +114,7 @@ do_mkfs_btrfs (char *const *devices,
char nodesize_s[64];
char sectorsize_s[64];
- ADD_ARG (argv, i...
2014 Nov 26
5
[PATCH] tools: implement --short-options
...g-options")) {
display_long_options (long_options);
}
+ else if (STREQ (long_options[option_index].name, "short-options")) {
+ display_short_options (options);
+ }
else if (STREQ (long_options[option_index].name, "floppy")) {
size_str = "1440K";
partition = "mbr";
diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml
index 83ebd3a..89d8412 100644
--- a/mllib/common_utils.ml
+++ b/mllib/common_utils.ml
@@ -421,8 +421,15 @@ let skip_dashes str =
let compare_command_line_args a b =
compare (Str...
2012 Aug 30
1
[PATCH] collect list of called external commands
...lable ("btrfs") > 0;
+ return prog_exists (str_btrfs) && filesystem_available ("btrfs") > 0;
}
/* Takes optional arguments, consult optargs_bitmask. */
@@ -46,7 +51,7 @@ do_btrfs_filesystem_resize (const char *filesystem, int64_t size)
size_t i = 0;
char size_str[32];
- ADD_ARG (argv, i, "btrfs");
+ ADD_ARG (argv, i, str_btrfs);
ADD_ARG (argv, i, "filesystem");
ADD_ARG (argv, i, "resize");
@@ -109,7 +114,7 @@ do_mkfs_btrfs (char *const *devices,
char nodesize_s[64];
char sectorsize_s[64];
- ADD_ARG (argv, i...