Libguestfs
Threads by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- 4 participants
- 7463 discussions
05 Oct '15
We don't support RHEL 5 upstream (see the 'oldlinux' branch for a
version that works with RHEL 5). Therefore remove a bunch of hacks
that were only needed on RHEL 5.
---
appliance/packagelist.in | 2 -
common-rules.mk | 8 -
daemon/parted.c | 455 +++++++++++-----------------------------
daemon/swap.c | 18 +-
generator/actions.ml | 4 +-
generator/ruby.ml | 14 --
run.in | 13 +-
src/inspect-apps.c | 13 --
tests/regressions/rhbz975797.sh | 5 +-
tests/xml/fake-libvirt-xml.c | 9 -
10 files changed, 129 insertions(+), 412 deletions(-)
diff --git a/appliance/packagelist.in b/appliance/packagelist.in
index fee6fa0..aa5e07e 100644
--- a/appliance/packagelist.in
+++ b/appliance/packagelist.in
@@ -28,8 +28,6 @@ ifelse(REDHAT,1,
cryptsetup
cryptsetup-luks dnl old name used before Fedora 17
dhclient
- dnl e4fsprogs only exists on RHEL 5, will be ignored everywhere else.
- e4fsprogs
genisoimage
gfs-utils
gfs2-utils
diff --git a/common-rules.mk b/common-rules.mk
index 312107e..e6b40d1 100644
--- a/common-rules.mk
+++ b/common-rules.mk
@@ -19,11 +19,3 @@
# cf. 'subdir-rules.mk'
-include $(top_builddir)/localenv
-
-# Old RHEL 5 autoconf defines these, but RHEL 5 automake doesn't
-# create variables for them. So define them here if they're not
-# defined already.
-builddir ?= @builddir@
-abs_builddir ?= @abs_builddir@
-srcdir ?= @srcdir@
-abs_srcdir ?= @abs_srcdir@
diff --git a/daemon/parted.c b/daemon/parted.c
index fab3423..df6b7e7 100644
--- a/daemon/parted.c
+++ b/daemon/parted.c
@@ -20,6 +20,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <stdbool.h>
#include <stdint.h>
#include <inttypes.h>
#include <string.h>
@@ -33,13 +34,6 @@ GUESTFSD_EXT_CMD(str_parted, parted);
GUESTFSD_EXT_CMD(str_sfdisk, sfdisk);
GUESTFSD_EXT_CMD(str_sgdisk, sgdisk);
-enum parted_has_m_opt {
- PARTED_INVALID = -1,
- /* parted do not support -m option */
- PARTED_OPT_NO_M = 0,
- PARTED_OPT_HAS_M = 1,
-};
-
/* Notes:
*
* Parted 1.9 sends error messages to stdout, hence use of the
@@ -319,43 +313,14 @@ get_table_field (const char *line, int n)
return q;
}
-/* RHEL 5 parted doesn't have the -m (machine readable) option so we
- * must do a lot more work to parse the output in
- * print_partition_table below. Test for this option the first time
- * this function is called.
- */
-static enum parted_has_m_opt
-test_parted_m_opt (void)
-{
- static enum parted_has_m_opt result = PARTED_INVALID;
-
- if (result >= 0)
- return result;
-
- CLEANUP_FREE char *err = NULL;
- int r = commandr (NULL, &err, str_parted, "-s", "-m", "/dev/null", NULL);
- if (r == -1) {
- /* Test failed, eg. missing or completely unusable parted binary. */
- reply_with_error ("could not run 'parted' command");
- return -1;
- }
-
- if (err && strstr (err, "invalid option -- m"))
- result = PARTED_OPT_NO_M;
- else
- result = PARTED_OPT_HAS_M;
- return result;
-}
-
static char *
-print_partition_table (const char *device,
- enum parted_has_m_opt parted_has_m_opt)
+print_partition_table (const char *device, bool add_m_option)
{
char *out;
CLEANUP_FREE char *err = NULL;
int r;
- if (PARTED_OPT_HAS_M == parted_has_m_opt)
+ if (add_m_option)
r = command (&out, &err, str_parted, "-m", "-s", "--", device,
"unit", "b",
"print", NULL);
@@ -364,15 +329,13 @@ print_partition_table (const char *device,
"unit", "b",
"print", NULL);
if (r == -1) {
- /* Hack for parted 1.x which sends errors to stdout. */
- const char *msg = *err ? err : out;
int errcode = 0;
/* Translate "unrecognised disk label" into an errno code. */
- if (msg && strstr (msg, "unrecognised disk label") != NULL)
+ if (err && strstr (err, "unrecognised disk label") != NULL)
errcode = EINVAL;
- reply_with_error_errno (errcode, "parted print: %s: %s", device, msg);
+ reply_with_error_errno (errcode, "parted print: %s: %s", device, err);
free (out);
return NULL;
}
@@ -383,93 +346,46 @@ print_partition_table (const char *device,
char *
do_part_get_parttype (const char *device)
{
- enum parted_has_m_opt parted_has_m_opt = test_parted_m_opt ();
- if (parted_has_m_opt == PARTED_INVALID)
- return NULL;
-
- CLEANUP_FREE char *out = print_partition_table (device, parted_has_m_opt);
+ CLEANUP_FREE char *out = print_partition_table (device, true);
if (!out)
return NULL;
- if (PARTED_OPT_HAS_M == parted_has_m_opt) {
- /* New-style parsing using the "machine-readable" format from
- * 'parted -m'.
- */
- CLEANUP_FREE_STRING_LIST char **lines = split_lines (out);
-
- if (!lines)
- return NULL;
-
- if (lines[0] == NULL || STRNEQ (lines[0], "BYT;")) {
- reply_with_error ("unknown signature, expected \"BYT;\" as first line of the output: %s",
- lines[0] ? lines[0] : "(signature was null)");
- return NULL;
- }
-
- if (lines[1] == NULL) {
- reply_with_error ("parted didn't return a line describing the device");
- return NULL;
- }
-
- /* lines[1] is something like:
- * "/dev/sda:1953525168s:scsi:512:512:msdos:ATA Hitachi HDT72101;"
- */
- char *r = get_table_field (lines[1], 5);
- if (r == NULL) {
- return NULL;
- }
-
- /* If "loop" return an error (RHBZ#634246). */
- if (STREQ (r, "loop")) {
- free (r);
- reply_with_error ("not a partitioned device");
- return NULL;
- }
-
- return r;
+ CLEANUP_FREE_STRING_LIST char **lines = split_lines (out);
+ if (!lines)
+ return NULL;
+
+ if (lines[0] == NULL || STRNEQ (lines[0], "BYT;")) {
+ reply_with_error ("unknown signature, expected \"BYT;\" as first line of the output: %s",
+ lines[0] ? lines[0] : "(signature was null)");
+ return NULL;
}
- else {
- /* Old-style. Look for "\nPartition Table: <str>\n". */
- char *p = strstr (out, "\nPartition Table: ");
- if (!p) {
- reply_with_error ("parted didn't return Partition Table line");
- return NULL;
- }
- p += 18;
- char *q = strchr (p, '\n');
- if (!q) {
- reply_with_error ("parted Partition Table has no end of line char");
- return NULL;
- }
-
- *q = '\0';
-
- p = strdup (p);
- if (!p) {
- reply_with_perror ("strdup");
- return NULL;
- }
-
- /* If "loop" return an error (RHBZ#634246). */
- if (STREQ (p, "loop")) {
- free (p);
- reply_with_error ("not a partitioned device");
- return NULL;
- }
+ if (lines[1] == NULL) {
+ reply_with_error ("parted didn't return a line describing the device");
+ return NULL;
+ }
- return p; /* caller frees */
+ /* lines[1] is something like:
+ * "/dev/sda:1953525168s:scsi:512:512:msdos:ATA Hitachi HDT72101;"
+ */
+ char *r = get_table_field (lines[1], 5);
+ if (r == NULL)
+ return NULL;
+
+ /* If "loop" return an error (RHBZ#634246). */
+ if (STREQ (r, "loop")) {
+ free (r);
+ reply_with_error ("not a partitioned device");
+ return NULL;
}
+
+ return r;
}
guestfs_int_partition_list *
do_part_list (const char *device)
{
- enum parted_has_m_opt parted_has_m_opt = test_parted_m_opt ();
- if (parted_has_m_opt == PARTED_INVALID)
- return NULL;
-
- CLEANUP_FREE char *out = print_partition_table (device, parted_has_m_opt);
+ CLEANUP_FREE char *out = print_partition_table (device, true);
if (!out)
return NULL;
@@ -480,97 +396,36 @@ do_part_list (const char *device)
guestfs_int_partition_list *r;
- if (PARTED_OPT_HAS_M == parted_has_m_opt) {
- /* New-style parsing using the "machine-readable" format from
- * 'parted -m'.
- *
- * lines[0] is "BYT;", lines[1] is the device line which we ignore,
- * lines[2..] are the partitions themselves. Count how many.
- */
- size_t nr_rows = 0, row;
- for (row = 2; lines[row] != NULL; ++row)
- ++nr_rows;
-
- r = malloc (sizeof *r);
- if (r == NULL) {
- reply_with_perror ("malloc");
- return NULL;
- }
- r->guestfs_int_partition_list_len = nr_rows;
- r->guestfs_int_partition_list_val =
- malloc (nr_rows * sizeof (guestfs_int_partition));
- if (r->guestfs_int_partition_list_val == NULL) {
- reply_with_perror ("malloc");
- goto error2;
- }
-
- /* Now parse the lines. */
- size_t i;
- for (i = 0, row = 2; lines[row] != NULL; ++i, ++row) {
- if (sscanf (lines[row], "%d:%" SCNi64 "B:%" SCNi64 "B:%" SCNi64 "B",
- &r->guestfs_int_partition_list_val[i].part_num,
- &r->guestfs_int_partition_list_val[i].part_start,
- &r->guestfs_int_partition_list_val[i].part_end,
- &r->guestfs_int_partition_list_val[i].part_size) != 4) {
- reply_with_error ("could not parse row from output of parted print command: %s", lines[row]);
- goto error3;
- }
- }
+ /* lines[0] is "BYT;", lines[1] is the device line which we ignore,
+ * lines[2..] are the partitions themselves. Count how many.
+ */
+ size_t nr_rows = 0, row;
+ for (row = 2; lines[row] != NULL; ++row)
+ ++nr_rows;
+
+ r = malloc (sizeof *r);
+ if (r == NULL) {
+ reply_with_perror ("malloc");
+ return NULL;
+ }
+ r->guestfs_int_partition_list_len = nr_rows;
+ r->guestfs_int_partition_list_val =
+ malloc (nr_rows * sizeof (guestfs_int_partition));
+ if (r->guestfs_int_partition_list_val == NULL) {
+ reply_with_perror ("malloc");
+ goto error2;
}
- else {
- /* Old-style. Start at the line following "^Number", up to the
- * next blank line.
- */
- size_t start = 0, end = 0, row;
-
- for (row = 0; lines[row] != NULL; ++row)
- if (STRPREFIX (lines[row], "Number")) {
- start = row+1;
- break;
- }
-
- if (start == 0) {
- reply_with_error ("parted output has no \"Number\" line");
- return NULL;
- }
-
- for (row = start; lines[row] != NULL; ++row)
- if (STREQ (lines[row], "")) {
- end = row;
- break;
- }
-
- if (end == 0) {
- reply_with_error ("parted output has no blank after end of table");
- return NULL;
- }
-
- size_t nr_rows = end - start;
-
- r = malloc (sizeof *r);
- if (r == NULL) {
- reply_with_perror ("malloc");
- return NULL;
- }
- r->guestfs_int_partition_list_len = nr_rows;
- r->guestfs_int_partition_list_val =
- malloc (nr_rows * sizeof (guestfs_int_partition));
- if (r->guestfs_int_partition_list_val == NULL) {
- reply_with_perror ("malloc");
- goto error2;
- }
- /* Now parse the lines. */
- size_t i;
- for (i = 0, row = start; row < end; ++i, ++row) {
- if (sscanf (lines[row], " %d %" SCNi64 "B %" SCNi64 "B %" SCNi64 "B",
- &r->guestfs_int_partition_list_val[i].part_num,
- &r->guestfs_int_partition_list_val[i].part_start,
- &r->guestfs_int_partition_list_val[i].part_end,
- &r->guestfs_int_partition_list_val[i].part_size) != 4) {
- reply_with_error ("could not parse row from output of parted print command: %s", lines[row]);
- goto error3;
- }
+ /* Now parse the lines. */
+ size_t i;
+ for (i = 0, row = 2; lines[row] != NULL; ++i, ++row) {
+ if (sscanf (lines[row], "%d:%" SCNi64 "B:%" SCNi64 "B:%" SCNi64 "B",
+ &r->guestfs_int_partition_list_val[i].part_num,
+ &r->guestfs_int_partition_list_val[i].part_start,
+ &r->guestfs_int_partition_list_val[i].part_end,
+ &r->guestfs_int_partition_list_val[i].part_size) != 4) {
+ reply_with_error ("could not parse row from output of parted print command: %s", lines[row]);
+ goto error3;
}
}
@@ -591,11 +446,7 @@ do_part_get_bootable (const char *device, int partnum)
return -1;
}
- enum parted_has_m_opt parted_has_m_opt = test_parted_m_opt ();
- if (parted_has_m_opt == PARTED_INVALID)
- return -1;
-
- CLEANUP_FREE char *out = print_partition_table (device, parted_has_m_opt);
+ CLEANUP_FREE char *out = print_partition_table (device, true);
if (!out)
return -1;
@@ -604,95 +455,41 @@ do_part_get_bootable (const char *device, int partnum)
if (!lines)
return -1;
- if (PARTED_OPT_HAS_M == parted_has_m_opt) {
- /* New-style parsing using the "machine-readable" format from
- * 'parted -m'.
- *
- * Partitions may not be in any order, so we have to look for
- * the matching partition number (RHBZ#602997).
- */
- if (lines[0] == NULL || STRNEQ (lines[0], "BYT;")) {
- reply_with_error ("unknown signature, expected \"BYT;\" as first line of the output: %s",
- lines[0] ? lines[0] : "(signature was null)");
- return -1;
- }
-
- if (lines[1] == NULL) {
- reply_with_error ("parted didn't return a line describing the device");
- return -1;
- }
-
- size_t row;
- int pnum;
- for (row = 2; lines[row] != NULL; ++row) {
- if (sscanf (lines[row], "%d:", &pnum) != 1) {
- reply_with_error ("could not parse row from output of parted print command: %s", lines[row]);
- return -1;
- }
- if (pnum == partnum)
- break;
- }
-
- if (lines[row] == NULL) {
- reply_with_error ("partition number %d not found", partnum);
- return -1;
- }
-
- CLEANUP_FREE char *boot = get_table_field (lines[row], 6);
- if (boot == NULL)
- return -1;
-
- return strstr (boot, "boot") != NULL;
+ /* Partitions may not be in any order, so we have to look for
+ * the matching partition number (RHBZ#602997).
+ */
+ if (lines[0] == NULL || STRNEQ (lines[0], "BYT;")) {
+ reply_with_error ("unknown signature, expected \"BYT;\" as first line of the output: %s",
+ lines[0] ? lines[0] : "(signature was null)");
+ return -1;
}
- else {
- /* Old-style: First look for the line matching "^Number". */
- size_t start = 0, header, row;
-
- for (row = 0; lines[row] != NULL; ++row)
- if (STRPREFIX (lines[row], "Number")) {
- start = row+1;
- header = row;
- break;
- }
- if (start == 0) {
- reply_with_error ("parted output has no \"Number\" line");
- return -1;
- }
+ if (lines[1] == NULL) {
+ reply_with_error ("parted didn't return a line describing the device");
+ return -1;
+ }
- /* Now we have to look at the column number of the "Flags" field.
- * This is because parted's output has no way to represent a
- * missing field except as whitespace, so we cannot just count
- * fields from the left. eg. The "File system" field is often
- * missing in the output.
- */
- char *p = strstr (lines[header], "Flags");
- if (!p) {
- reply_with_error ("parted output has no \"Flags\" field");
+ size_t row;
+ int pnum;
+ for (row = 2; lines[row] != NULL; ++row) {
+ if (sscanf (lines[row], "%d:", &pnum) != 1) {
+ reply_with_error ("could not parse row from output of parted print command: %s", lines[row]);
return -1;
}
- size_t col = p - lines[header];
+ if (pnum == partnum)
+ break;
+ }
- /* Partitions may not be in any order, so we have to look for
- * the matching partition number (RHBZ#602997).
- */
- int pnum;
- for (row = start; lines[row] != NULL; ++row) {
- if (sscanf (lines[row], " %d", &pnum) != 1) {
- reply_with_error ("could not parse row from output of parted print command: %s", lines[row]);
- return -1;
- }
- if (pnum == partnum)
- break;
- }
+ if (lines[row] == NULL) {
+ reply_with_error ("partition number %d not found", partnum);
+ return -1;
+ }
- if (lines[row] == NULL) {
- reply_with_error ("partition number %d not found", partnum);
- return -1;
- }
+ CLEANUP_FREE char *boot = get_table_field (lines[row], 6);
+ if (boot == NULL)
+ return -1;
- return STRPREFIX (&lines[row][col], "boot");
- }
+ return strstr (boot, "boot") != NULL;
}
/* Test if sfdisk is recent enough to have --part-type, to be used instead
@@ -979,63 +776,51 @@ do_part_get_name (const char *device, int partnum)
return NULL;
if (STREQ (parttype, "gpt")) {
- enum parted_has_m_opt parted_has_m_opt = test_parted_m_opt ();
- if (parted_has_m_opt == PARTED_INVALID)
- return NULL;
-
- CLEANUP_FREE char *out = print_partition_table (device, parted_has_m_opt);
+ CLEANUP_FREE char *out = print_partition_table (device, true);
if (!out)
return NULL;
- if (PARTED_OPT_HAS_M == parted_has_m_opt) {
- /* New-style parsing using the "machine-readable" format from
- * 'parted -m'.
- */
- CLEANUP_FREE_STRING_LIST char **lines = split_lines (out);
+ CLEANUP_FREE_STRING_LIST char **lines = split_lines (out);
- if (!lines)
- return NULL;
-
- if (lines[0] == NULL || STRNEQ (lines[0], "BYT;")) {
- reply_with_error ("unknown signature, expected \"BYT;\" as first line of the output: %s",
- lines[0] ? lines[0] : "(signature was null)");
- return NULL;
- }
+ if (!lines)
+ return NULL;
- if (lines[1] == NULL) {
- reply_with_error ("parted didn't return a line describing the device");
- return NULL;
- }
+ if (lines[0] == NULL || STRNEQ (lines[0], "BYT;")) {
+ reply_with_error ("unknown signature, expected \"BYT;\" as first line of the output: %s",
+ lines[0] ? lines[0] : "(signature was null)");
+ return NULL;
+ }
- size_t row;
- int pnum;
- for (row = 2; lines[row] != NULL; ++row) {
- if (sscanf (lines[row], "%d:", &pnum) != 1) {
- reply_with_error ("could not parse row from output of parted print command: %s", lines[row]);
- return NULL;
- }
- if (pnum == partnum)
- break;
- }
+ if (lines[1] == NULL) {
+ reply_with_error ("parted didn't return a line describing the device");
+ return NULL;
+ }
- if (lines[row] == NULL) {
- reply_with_error ("partition number %d not found", partnum);
+ size_t row;
+ int pnum;
+ for (row = 2; lines[row] != NULL; ++row) {
+ if (sscanf (lines[row], "%d:", &pnum) != 1) {
+ reply_with_error ("could not parse row from output of parted print command: %s", lines[row]);
return NULL;
}
+ if (pnum == partnum)
+ break;
+ }
- char *name = get_table_field (lines[row], 5);
- if (name == NULL)
- reply_with_error ("cannot get the name field from '%s'", lines[row]);
-
- return name;
+ if (lines[row] == NULL) {
+ reply_with_error ("partition number %d not found", partnum);
+ return NULL;
}
+
+ char *name = get_table_field (lines[row], 5);
+ if (name == NULL)
+ reply_with_error ("cannot get the name field from '%s'", lines[row]);
+
+ return name;
} else {
reply_with_error ("part-get-name can only be used on GUID Partition Tables");
return NULL;
}
-
- reply_with_error ("cannot get the partition name from '%s' layouts", parttype);
- return NULL;
}
char *
@@ -1052,7 +837,7 @@ do_part_get_mbr_part_type (const char *device, int partnum)
* partition type info.
* Use traditional style.
*/
- CLEANUP_FREE char *out = print_partition_table (device, PARTED_OPT_NO_M);
+ CLEANUP_FREE char *out = print_partition_table (device, false);
if (!out)
return NULL;
diff --git a/daemon/swap.c b/daemon/swap.c
index 26fe30d..9d7839e 100644
--- a/daemon/swap.c
+++ b/daemon/swap.c
@@ -38,26 +38,10 @@ GUESTFSD_EXT_CMD(str_swaplabel, swaplabel);
/* Confirmed this is true for Linux swap partitions from the Linux sources. */
#define SWAP_LABEL_MAX 16
-/* Convenient place to test for the later version of e2fsprogs
- * and util-linux which supports -U parameters to specify UUIDs.
- * (Not supported in RHEL 5).
- */
int
optgroup_linuxfsuuid_available (void)
{
- CLEANUP_FREE char *err = NULL;
- int av;
-
- /* Upstream util-linux have been gradually changing '--help' to go
- * from stderr to stdout, and changing the return code from 1 to 0.
- * Thus we need to fold stdout and stderr together, and ignore the
- * return code.
- */
- ignore_value (commandf (NULL, &err, COMMAND_FLAG_FOLD_STDOUT_ON_STDERR,
- str_mkswap, "--help", NULL));
-
- av = strstr (err, "-U") != NULL;
- return av;
+ return 1;
}
/* Takes optional arguments, consult optargs_bitmask. */
diff --git a/generator/actions.ml b/generator/actions.ml
index 12d5e5a..2f29f7a 100644
--- a/generator/actions.ml
+++ b/generator/actions.ml
@@ -6169,11 +6169,11 @@ the command C<mount -o loop file mountpoint>." };
InitEmpty, Always, TestRun (
[["part_disk"; "/dev/sda"; "mbr"];
["mkswap"; "/dev/sda1"; "hello"; "NOARG"]]), [];
- InitEmpty, IfAvailable "linuxfsuuid", TestResultString (
+ InitEmpty, Always, TestResultString (
[["part_disk"; "/dev/sda"; "mbr"];
["mkswap"; "/dev/sda1"; "NOARG"; uuid];
["vfs_uuid"; "/dev/sda1"]], uuid), [];
- InitEmpty, IfAvailable "linuxfsuuid", TestResultString (
+ InitEmpty, Always, TestResultString (
[["part_disk"; "/dev/sda"; "mbr"];
["mkswap"; "/dev/sda1"; "hello"; uuid];
["vfs_label"; "/dev/sda1"]], "hello"), []
diff --git a/generator/ruby.ml b/generator/ruby.ml
index 87bb34a..cb187b0 100644
--- a/generator/ruby.ml
+++ b/generator/ruby.ml
@@ -84,20 +84,6 @@ let rec generate_ruby_c () =
#define RSTRING_PTR(r) (RSTRING((r))->ptr)
#endif
-/* For RHEL 5 (Ruby 1.8.5) */
-#ifndef HAVE_RB_HASH_LOOKUP
-VALUE
-rb_hash_lookup (VALUE hash, VALUE key)
-{
- volatile VALUE val;
-
- if (!st_lookup (RHASH(hash)->tbl, key, &val))
- return Qnil;
-
- return val;
-}
-#endif /* !HAVE_RB_HASH_LOOKUP */
-
static VALUE m_guestfs; /* guestfs module */
static VALUE c_guestfs; /* guestfs_h handle */
static VALUE e_Error; /* used for all errors */
diff --git a/run.in b/run.in
index 42f8cc8..46dbaf0 100755
--- a/run.in
+++ b/run.in
@@ -238,14 +238,11 @@ fi
timeout_period=4h
timeout_kill=30s
-# Do we have Padraig's timeout utility (from coreutils)?
-if timeout --help >/dev/null 2>&1; then
- # Must use the --foreground option (RHBZ#1025269).
- if timeout --foreground 2 sleep 0 >/dev/null 2>&1; then
- # Does this version of timeout have the -k option? (Not on RHEL 6)
- if timeout -k 10s 10s true >/dev/null 2>&1; then
- timeout="timeout --foreground -k $timeout_kill $timeout_period"
- fi
+# Must use the --foreground option (RHBZ#1025269).
+if timeout --foreground 2 sleep 0 >/dev/null 2>&1; then
+ # Does this version of timeout have the -k option? (Not on RHEL 6)
+ if timeout -k 10s 10s true >/dev/null 2>&1; then
+ timeout="timeout --foreground -k $timeout_kill $timeout_period"
fi
fi
diff --git a/src/inspect-apps.c b/src/inspect-apps.c
index a7da1dc..b54cf07 100644
--- a/src/inspect-apps.c
+++ b/src/inspect-apps.c
@@ -30,12 +30,6 @@
#include <sys/endian.h>
#endif
-/* be32toh is usually a macro defined in <endian.h>, but it might be
- * a function in some system so check both, and if neither is defined
- * then define be32toh for RHEL 5.
- */
-#if !defined(HAVE_BE32TOH) && !defined(be32toh)
-
#if defined __APPLE__ && defined __MACH__
/* Define/include necessary items on MacOS X */
#include <machine/endian.h>
@@ -46,13 +40,6 @@
#define __bswap_32 OSSwapConstInt32
#endif /* __APPLE__ */
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-#define be32toh(x) __bswap_32 (x)
-#else
-#define be32toh(x) (x)
-#endif
-#endif
-
#include "guestfs.h"
#include "guestfs-internal.h"
#include "guestfs-internal-actions.h"
diff --git a/tests/regressions/rhbz975797.sh b/tests/regressions/rhbz975797.sh
index 938c1c5..3c536a9 100755
--- a/tests/regressions/rhbz975797.sh
+++ b/tests/regressions/rhbz975797.sh
@@ -51,10 +51,7 @@ fi
rm -f rhbz975797-*.img
-# The timeout utility was not available in RHEL 5.
-if timeout --help >/dev/null 2>&1; then
- timeout="timeout 600"
-fi
+timeout="timeout 600"
# Use real disk images here since the code for adding /dev/null may
# take shortcuts.
diff --git a/tests/xml/fake-libvirt-xml.c b/tests/xml/fake-libvirt-xml.c
index b7ab7a8..a34b700 100644
--- a/tests/xml/fake-libvirt-xml.c
+++ b/tests/xml/fake-libvirt-xml.c
@@ -25,15 +25,6 @@
#include <sys/types.h>
#include <sys/stat.h>
-/* We're not using gnulib here so that we don't have to link to gnulib
- * rpl_* libraries (not possible since this is an LD_PRELOAD lib).
- * However that does mean we have to define O_CLOEXEC explicitly for
- * RHEL 5.
- */
-#ifndef O_CLOEXEC
-#define O_CLOEXEC 0
-#endif
-
/* Old <libvirt.h> had a slightly different definition of
* virDomainGetXMLDesc (using 'int' for flags instead of 'unsigned
* int'). To avoid an error trying to redefine it with a different
--
2.5.0
2
2
Result of earlier copy and paste.
---
align/scan.c | 35 ++++++++++---------
cat/cat.c | 39 +++++++++++----------
cat/filesystems.c | 69 +++++++++++++++++++-------------------
cat/log.c | 35 ++++++++++---------
cat/ls.c | 61 +++++++++++++++++----------------
df/main.c | 43 ++++++++++++------------
diff/diff.c | 67 ++++++++++++++++++-------------------
edit/edit.c | 43 ++++++++++++------------
fish/fish.c | 93 +++++++++++++++++++++++++--------------------------
format/format.c | 45 ++++++++++++-------------
fuse/guestmount.c | 61 +++++++++++++++++----------------
fuse/guestunmount.c | 27 +++++++--------
inspector/inspector.c | 37 ++++++++++----------
make-fs/make-fs.c | 37 ++++++++++----------
p2v/main.c | 21 ++++++------
rescue/rescue.c | 49 +++++++++++++--------------
16 files changed, 373 insertions(+), 389 deletions(-)
diff --git a/align/scan.c b/align/scan.c
index 188450c..ef92f42 100644
--- a/align/scan.c
+++ b/align/scan.c
@@ -73,24 +73,23 @@ usage (int status)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
guestfs_int_program_name);
else {
- fprintf (stdout,
- _("%s: check alignment of virtual machine partitions\n"
- "Copyright (C) 2011 Red Hat Inc.\n"
- "Usage:\n"
- " %s [--options] -d domname\n"
- " %s [--options] -a disk.img [-a disk.img ...]\n"
- "Options:\n"
- " -a|--add image Add image\n"
- " -c|--connect uri Specify libvirt URI for -d option\n"
- " -d|--domain guest Add disks from libvirt guest\n"
- " --format[=raw|..] Force disk format for -a option\n"
- " --help Display brief help\n"
- " -P nr_threads Use at most nr_threads\n"
- " -q|--quiet No output, just exit code\n"
- " -v|--verbose Verbose messages\n"
- " -V|--version Display version and exit\n"
- " -x Trace libguestfs API calls\n"
- "For more information, see the manpage %s(1).\n"),
+ printf (_("%s: check alignment of virtual machine partitions\n"
+ "Copyright (C) 2011 Red Hat Inc.\n"
+ "Usage:\n"
+ " %s [--options] -d domname\n"
+ " %s [--options] -a disk.img [-a disk.img ...]\n"
+ "Options:\n"
+ " -a|--add image Add image\n"
+ " -c|--connect uri Specify libvirt URI for -d option\n"
+ " -d|--domain guest Add disks from libvirt guest\n"
+ " --format[=raw|..] Force disk format for -a option\n"
+ " --help Display brief help\n"
+ " -P nr_threads Use at most nr_threads\n"
+ " -q|--quiet No output, just exit code\n"
+ " -v|--verbose Verbose messages\n"
+ " -V|--version Display version and exit\n"
+ " -x Trace libguestfs API calls\n"
+ "For more information, see the manpage %s(1).\n"),
guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name,
guestfs_int_program_name);
}
diff --git a/cat/cat.c b/cat/cat.c
index 82f0055..222cfa9 100644
--- a/cat/cat.c
+++ b/cat/cat.c
@@ -53,26 +53,25 @@ usage (int status)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
guestfs_int_program_name);
else {
- fprintf (stdout,
- _("%s: display files in a virtual machine\n"
- "Copyright (C) 2010 Red Hat Inc.\n"
- "Usage:\n"
- " %s [--options] -d domname file [file ...]\n"
- " %s [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
- "Options:\n"
- " -a|--add image Add image\n"
- " -c|--connect uri Specify libvirt URI for -d option\n"
- " -d|--domain guest Add disks from libvirt guest\n"
- " --echo-keys Don't turn off echo for passphrases\n"
- " --format[=raw|..] Force disk format for -a option\n"
- " --help Display brief help\n"
- " --keys-from-stdin Read passphrases from stdin\n"
- " -m|--mount dev[:mnt[:opts[:fstype]]]\n"
- " Mount dev on mnt (if omitted, /)\n"
- " -v|--verbose Verbose messages\n"
- " -V|--version Display version and exit\n"
- " -x Trace libguestfs API calls\n"
- "For more information, see the manpage %s(1).\n"),
+ printf (_("%s: display files in a virtual machine\n"
+ "Copyright (C) 2010 Red Hat Inc.\n"
+ "Usage:\n"
+ " %s [--options] -d domname file [file ...]\n"
+ " %s [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
+ "Options:\n"
+ " -a|--add image Add image\n"
+ " -c|--connect uri Specify libvirt URI for -d option\n"
+ " -d|--domain guest Add disks from libvirt guest\n"
+ " --echo-keys Don't turn off echo for passphrases\n"
+ " --format[=raw|..] Force disk format for -a option\n"
+ " --help Display brief help\n"
+ " --keys-from-stdin Read passphrases from stdin\n"
+ " -m|--mount dev[:mnt[:opts[:fstype]]]\n"
+ " Mount dev on mnt (if omitted, /)\n"
+ " -v|--verbose Verbose messages\n"
+ " -V|--version Display version and exit\n"
+ " -x Trace libguestfs API calls\n"
+ "For more information, see the manpage %s(1).\n"),
guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name,
guestfs_int_program_name);
}
diff --git a/cat/filesystems.c b/cat/filesystems.c
index 0e64e00..ef4f6ba 100644
--- a/cat/filesystems.c
+++ b/cat/filesystems.c
@@ -87,41 +87,40 @@ usage (int status)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
guestfs_int_program_name);
else {
- fprintf (stdout,
- _("%s: list filesystems, partitions, block devices, LVM in a VM\n"
- "Copyright (C) 2010 Red Hat Inc.\n"
- "Usage:\n"
- " %s [--options] -d domname\n"
- " %s [--options] -a disk.img [-a disk.img ...]\n"
- "Options:\n"
- " -a|--add image Add image\n"
- " --all Display everything\n"
- " --blkdevs|--block-devices\n"
- " Display block devices\n"
- " -c|--connect uri Specify libvirt URI for -d option\n"
- " --csv Output as Comma-Separated Values\n"
- " -d|--domain guest Add disks from libvirt guest\n"
- " --echo-keys Don't turn off echo for passphrases\n"
- " --extra Display swap and data filesystems\n"
- " --filesystems Display mountable filesystems\n"
- " --format[=raw|..] Force disk format for -a option\n"
- " -h|--human-readable Human-readable sizes in --long output\n"
- " --help Display brief help\n"
- " --keys-from-stdin Read passphrases from stdin\n"
- " -l|--long Long output\n"
- " --lvs|--logvols|--logical-volumes\n"
- " Display LVM logical volumes\n"
- " --no-title No title in --long output\n"
- " --parts|--partitions Display partitions\n"
- " --pvs|--physvols|--physical-volumes\n"
- " Display LVM physical volumes\n"
- " --uuid|--uuids Add UUIDs to --long output\n"
- " -v|--verbose Verbose messages\n"
- " -V|--version Display version and exit\n"
- " --vgs|--volgroups|--volume-groups\n"
- " Display LVM volume groups\n"
- " -x Trace libguestfs API calls\n"
- "For more information, see the manpage %s(1).\n"),
+ printf (_("%s: list filesystems, partitions, block devices, LVM in a VM\n"
+ "Copyright (C) 2010 Red Hat Inc.\n"
+ "Usage:\n"
+ " %s [--options] -d domname\n"
+ " %s [--options] -a disk.img [-a disk.img ...]\n"
+ "Options:\n"
+ " -a|--add image Add image\n"
+ " --all Display everything\n"
+ " --blkdevs|--block-devices\n"
+ " Display block devices\n"
+ " -c|--connect uri Specify libvirt URI for -d option\n"
+ " --csv Output as Comma-Separated Values\n"
+ " -d|--domain guest Add disks from libvirt guest\n"
+ " --echo-keys Don't turn off echo for passphrases\n"
+ " --extra Display swap and data filesystems\n"
+ " --filesystems Display mountable filesystems\n"
+ " --format[=raw|..] Force disk format for -a option\n"
+ " -h|--human-readable Human-readable sizes in --long output\n"
+ " --help Display brief help\n"
+ " --keys-from-stdin Read passphrases from stdin\n"
+ " -l|--long Long output\n"
+ " --lvs|--logvols|--logical-volumes\n"
+ " Display LVM logical volumes\n"
+ " --no-title No title in --long output\n"
+ " --parts|--partitions Display partitions\n"
+ " --pvs|--physvols|--physical-volumes\n"
+ " Display LVM physical volumes\n"
+ " --uuid|--uuids Add UUIDs to --long output\n"
+ " -v|--verbose Verbose messages\n"
+ " -V|--version Display version and exit\n"
+ " --vgs|--volgroups|--volume-groups\n"
+ " Display LVM volume groups\n"
+ " -x Trace libguestfs API calls\n"
+ "For more information, see the manpage %s(1).\n"),
guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name,
guestfs_int_program_name);
}
diff --git a/cat/log.c b/cat/log.c
index 616baed..a8e55d8 100644
--- a/cat/log.c
+++ b/cat/log.c
@@ -62,24 +62,23 @@ usage (int status)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
guestfs_int_program_name);
else {
- fprintf (stdout,
- _("%s: display log files in a virtual machine\n"
- "Copyright (C) 2010-2015 Red Hat Inc.\n"
- "Usage:\n"
- " %s [--options] -d domname\n"
- " %s [--options] -a disk.img [-a disk.img ...]\n"
- "Options:\n"
- " -a|--add image Add image\n"
- " -c|--connect uri Specify libvirt URI for -d option\n"
- " -d|--domain guest Add disks from libvirt guest\n"
- " --echo-keys Don't turn off echo for passphrases\n"
- " --format[=raw|..] Force disk format for -a option\n"
- " --help Display brief help\n"
- " --keys-from-stdin Read passphrases from stdin\n"
- " -v|--verbose Verbose messages\n"
- " -V|--version Display version and exit\n"
- " -x Trace libguestfs API calls\n"
- "For more information, see the manpage %s(1).\n"),
+ printf (_("%s: display log files in a virtual machine\n"
+ "Copyright (C) 2010-2015 Red Hat Inc.\n"
+ "Usage:\n"
+ " %s [--options] -d domname\n"
+ " %s [--options] -a disk.img [-a disk.img ...]\n"
+ "Options:\n"
+ " -a|--add image Add image\n"
+ " -c|--connect uri Specify libvirt URI for -d option\n"
+ " -d|--domain guest Add disks from libvirt guest\n"
+ " --echo-keys Don't turn off echo for passphrases\n"
+ " --format[=raw|..] Force disk format for -a option\n"
+ " --help Display brief help\n"
+ " --keys-from-stdin Read passphrases from stdin\n"
+ " -v|--verbose Verbose messages\n"
+ " -V|--version Display version and exit\n"
+ " -x Trace libguestfs API calls\n"
+ "For more information, see the manpage %s(1).\n"),
guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name,
guestfs_int_program_name);
}
diff --git a/cat/ls.c b/cat/ls.c
index 987dcef..b8f901d 100644
--- a/cat/ls.c
+++ b/cat/ls.c
@@ -83,37 +83,36 @@ usage (int status)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
guestfs_int_program_name);
else {
- fprintf (stdout,
- _("%s: list files in a virtual machine\n"
- "Copyright (C) 2010-2012 Red Hat Inc.\n"
- "Usage:\n"
- " %s [--options] -d domname dir [dir ...]\n"
- " %s [--options] -a disk.img [-a disk.img ...] dir [dir ...]\n"
- "Options:\n"
- " -a|--add image Add image\n"
- " --checksum[=...] Display file checksums\n"
- " -c|--connect uri Specify libvirt URI for -d option\n"
- " --csv Comma-Separated Values output\n"
- " -d|--domain guest Add disks from libvirt guest\n"
- " --echo-keys Don't turn off echo for passphrases\n"
- " --extra-stats Display extra stats\n"
- " --format[=raw|..] Force disk format for -a option\n"
- " --help Display brief help\n"
- " -h|--human-readable Human-readable sizes in output\n"
- " --keys-from-stdin Read passphrases from stdin\n"
- " -l|--long Long listing\n"
- " -m|--mount dev[:mnt[:opts[:fstype]]]\n"
- " Mount dev on mnt (if omitted, /)\n"
- " -R|--recursive Recursive listing\n"
- " --times Display file times\n"
- " --time-days Display file times as days before now\n"
- " --time-relative Display file times as seconds before now\n"
- " --time-t Display file times as time_t's\n"
- " --uids Display UID, GID\n"
- " -v|--verbose Verbose messages\n"
- " -V|--version Display version and exit\n"
- " -x Trace libguestfs API calls\n"
- "For more information, see the manpage %s(1).\n"),
+ printf (_("%s: list files in a virtual machine\n"
+ "Copyright (C) 2010-2012 Red Hat Inc.\n"
+ "Usage:\n"
+ " %s [--options] -d domname dir [dir ...]\n"
+ " %s [--options] -a disk.img [-a disk.img ...] dir [dir ...]\n"
+ "Options:\n"
+ " -a|--add image Add image\n"
+ " --checksum[=...] Display file checksums\n"
+ " -c|--connect uri Specify libvirt URI for -d option\n"
+ " --csv Comma-Separated Values output\n"
+ " -d|--domain guest Add disks from libvirt guest\n"
+ " --echo-keys Don't turn off echo for passphrases\n"
+ " --extra-stats Display extra stats\n"
+ " --format[=raw|..] Force disk format for -a option\n"
+ " --help Display brief help\n"
+ " -h|--human-readable Human-readable sizes in output\n"
+ " --keys-from-stdin Read passphrases from stdin\n"
+ " -l|--long Long listing\n"
+ " -m|--mount dev[:mnt[:opts[:fstype]]]\n"
+ " Mount dev on mnt (if omitted, /)\n"
+ " -R|--recursive Recursive listing\n"
+ " --times Display file times\n"
+ " --time-days Display file times as days before now\n"
+ " --time-relative Display file times as seconds before now\n"
+ " --time-t Display file times as time_t's\n"
+ " --uids Display UID, GID\n"
+ " -v|--verbose Verbose messages\n"
+ " -V|--version Display version and exit\n"
+ " -x Trace libguestfs API calls\n"
+ "For more information, see the manpage %s(1).\n"),
guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name,
guestfs_int_program_name);
}
diff --git a/df/main.c b/df/main.c
index 517bd45..ae5f250 100644
--- a/df/main.c
+++ b/df/main.c
@@ -66,28 +66,27 @@ usage (int status)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
guestfs_int_program_name);
else {
- fprintf (stdout,
- _("%s: display free space on virtual filesystems\n"
- "Copyright (C) 2010 Red Hat Inc.\n"
- "Usage:\n"
- " %s [--options] -d domname\n"
- " %s [--options] -a disk.img [-a disk.img ...]\n"
- "Options:\n"
- " -a|--add image Add image\n"
- " -c|--connect uri Specify libvirt URI for -d option\n"
- " --csv Output as Comma-Separated Values\n"
- " -d|--domain guest Add disks from libvirt guest\n"
- " --format[=raw|..] Force disk format for -a option\n"
- " -h|--human-readable Human-readable sizes in --long output\n"
- " --help Display brief help\n"
- " -i|--inodes Display inodes\n"
- " --one-per-guest Separate appliance per guest\n"
- " -P nr_threads Use at most nr_threads\n"
- " --uuid Add UUIDs to --long output\n"
- " -v|--verbose Verbose messages\n"
- " -V|--version Display version and exit\n"
- " -x Trace libguestfs API calls\n"
- "For more information, see the manpage %s(1).\n"),
+ printf (_("%s: display free space on virtual filesystems\n"
+ "Copyright (C) 2010 Red Hat Inc.\n"
+ "Usage:\n"
+ " %s [--options] -d domname\n"
+ " %s [--options] -a disk.img [-a disk.img ...]\n"
+ "Options:\n"
+ " -a|--add image Add image\n"
+ " -c|--connect uri Specify libvirt URI for -d option\n"
+ " --csv Output as Comma-Separated Values\n"
+ " -d|--domain guest Add disks from libvirt guest\n"
+ " --format[=raw|..] Force disk format for -a option\n"
+ " -h|--human-readable Human-readable sizes in --long output\n"
+ " --help Display brief help\n"
+ " -i|--inodes Display inodes\n"
+ " --one-per-guest Separate appliance per guest\n"
+ " -P nr_threads Use at most nr_threads\n"
+ " --uuid Add UUIDs to --long output\n"
+ " -v|--verbose Verbose messages\n"
+ " -V|--version Display version and exit\n"
+ " -x Trace libguestfs API calls\n"
+ "For more information, see the manpage %s(1).\n"),
guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name,
guestfs_int_program_name);
}
diff --git a/diff/diff.c b/diff/diff.c
index 1261439..52c29ea 100644
--- a/diff/diff.c
+++ b/diff/diff.c
@@ -92,40 +92,39 @@ usage (int status)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
guestfs_int_program_name);
else {
- fprintf (stdout,
- _("%s: list differences between virtual machines\n"
- "Copyright (C) 2010-2015 Red Hat Inc.\n"
- "Usage:\n"
- " %s [--options] -d domain1 -D domain2\n"
- " %s [--options] -a disk1.img -A disk2.img [-a|-A ...]\n"
- "Options:\n"
- " -a|--add image Add image from first guest\n"
- " --all Same as: --extra-stats --times --uids --xattrs\n"
- " --atime Don't ignore access time changes\n"
- " -A image Add image from second guest\n"
- " --checksum[=...] Use checksum of file content\n"
- " -c|--connect uri Specify libvirt URI for -d option\n"
- " --csv Comma-Separated Values output\n"
- " --dir-links Don't ignore directory nlink changes\n"
- " --dir-times Don't ignore directory time changes\n"
- " -d|--domain guest Add disks from first libvirt guest\n"
- " -D guest Add disks from second libvirt guest\n"
- " --echo-keys Don't turn off echo for passphrases\n"
- " --extra-stats Display extra stats\n"
- " --format[=raw|..] Force disk format for -a or -A option\n"
- " --help Display brief help\n"
- " -h|--human-readable Human-readable sizes in output\n"
- " --keys-from-stdin Read passphrases from stdin\n"
- " --times Display file times\n"
- " --time-days Display file times as days before now\n"
- " --time-relative Display file times as seconds before now\n"
- " --time-t Display file times as time_t's\n"
- " --uids Display UID, GID\n"
- " -v|--verbose Verbose messages\n"
- " -V|--version Display version and exit\n"
- " -x Trace libguestfs API calls\n"
- " --xattrs Display extended attributes\n"
- "For more information, see the manpage %s(1).\n"),
+ printf (_("%s: list differences between virtual machines\n"
+ "Copyright (C) 2010-2015 Red Hat Inc.\n"
+ "Usage:\n"
+ " %s [--options] -d domain1 -D domain2\n"
+ " %s [--options] -a disk1.img -A disk2.img [-a|-A ...]\n"
+ "Options:\n"
+ " -a|--add image Add image from first guest\n"
+ " --all Same as: --extra-stats --times --uids --xattrs\n"
+ " --atime Don't ignore access time changes\n"
+ " -A image Add image from second guest\n"
+ " --checksum[=...] Use checksum of file content\n"
+ " -c|--connect uri Specify libvirt URI for -d option\n"
+ " --csv Comma-Separated Values output\n"
+ " --dir-links Don't ignore directory nlink changes\n"
+ " --dir-times Don't ignore directory time changes\n"
+ " -d|--domain guest Add disks from first libvirt guest\n"
+ " -D guest Add disks from second libvirt guest\n"
+ " --echo-keys Don't turn off echo for passphrases\n"
+ " --extra-stats Display extra stats\n"
+ " --format[=raw|..] Force disk format for -a or -A option\n"
+ " --help Display brief help\n"
+ " -h|--human-readable Human-readable sizes in output\n"
+ " --keys-from-stdin Read passphrases from stdin\n"
+ " --times Display file times\n"
+ " --time-days Display file times as days before now\n"
+ " --time-relative Display file times as seconds before now\n"
+ " --time-t Display file times as time_t's\n"
+ " --uids Display UID, GID\n"
+ " -v|--verbose Verbose messages\n"
+ " -V|--version Display version and exit\n"
+ " -x Trace libguestfs API calls\n"
+ " --xattrs Display extended attributes\n"
+ "For more information, see the manpage %s(1).\n"),
guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name,
guestfs_int_program_name);
}
diff --git a/edit/edit.c b/edit/edit.c
index b874492..9df99c3 100644
--- a/edit/edit.c
+++ b/edit/edit.c
@@ -63,28 +63,27 @@ usage (int status)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
guestfs_int_program_name);
else {
- fprintf (stdout,
- _("%s: Edit a file in a virtual machine\n"
- "Copyright (C) 2009-2015 Red Hat Inc.\n"
- "Usage:\n"
- " %s [--options] -d domname file [file ...]\n"
- " %s [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
- "Options:\n"
- " -a|--add image Add image\n"
- " -b|--backup .ext Backup original as original.ext\n"
- " -c|--connect uri Specify libvirt URI for -d option\n"
- " -d|--domain guest Add disks from libvirt guest\n"
- " --echo-keys Don't turn off echo for passphrases\n"
- " -e|--expr expr Non-interactive editing using Perl expr\n"
- " --format[=raw|..] Force disk format for -a option\n"
- " --help Display brief help\n"
- " --keys-from-stdin Read passphrases from stdin\n"
- " -m|--mount dev[:mnt[:opts[:fstype]]]\n"
- " Mount dev on mnt (if omitted, /)\n"
- " -v|--verbose Verbose messages\n"
- " -V|--version Display version and exit\n"
- " -x Trace libguestfs API calls\n"
- "For more information, see the manpage %s(1).\n"),
+ printf (_("%s: Edit a file in a virtual machine\n"
+ "Copyright (C) 2009-2015 Red Hat Inc.\n"
+ "Usage:\n"
+ " %s [--options] -d domname file [file ...]\n"
+ " %s [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
+ "Options:\n"
+ " -a|--add image Add image\n"
+ " -b|--backup .ext Backup original as original.ext\n"
+ " -c|--connect uri Specify libvirt URI for -d option\n"
+ " -d|--domain guest Add disks from libvirt guest\n"
+ " --echo-keys Don't turn off echo for passphrases\n"
+ " -e|--expr expr Non-interactive editing using Perl expr\n"
+ " --format[=raw|..] Force disk format for -a option\n"
+ " --help Display brief help\n"
+ " --keys-from-stdin Read passphrases from stdin\n"
+ " -m|--mount dev[:mnt[:opts[:fstype]]]\n"
+ " Mount dev on mnt (if omitted, /)\n"
+ " -v|--verbose Verbose messages\n"
+ " -V|--version Display version and exit\n"
+ " -x Trace libguestfs API calls\n"
+ "For more information, see the manpage %s(1).\n"),
guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name,
guestfs_int_program_name);
}
diff --git a/fish/fish.c b/fish/fish.c
index c37368e..12a62a1 100644
--- a/fish/fish.c
+++ b/fish/fish.c
@@ -105,53 +105,52 @@ usage (int status)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
guestfs_int_program_name);
else {
- fprintf (stdout,
- _("%s: guest filesystem shell\n"
- "%s lets you edit virtual machine filesystems\n"
- "Copyright (C) 2009-2015 Red Hat Inc.\n"
- "Usage:\n"
- " %s [--options] cmd [: cmd : cmd ...]\n"
- "Options:\n"
- " -h|--cmd-help List available commands\n"
- " -h|--cmd-help cmd Display detailed help on 'cmd'\n"
- " -a|--add image Add image\n"
- " -c|--connect uri Specify libvirt URI for -d option\n"
- " --csh Make --listen csh-compatible\n"
- " -d|--domain guest Add disks from libvirt guest\n"
- " --echo-keys Don't turn off echo for passphrases\n"
- " -f|--file file Read commands from file\n"
- " --format[=raw|..] Force disk format for -a option\n"
- " -i|--inspector Automatically mount filesystems\n"
- " --keys-from-stdin Read passphrases from stdin\n"
- " --listen Listen for remote commands\n"
- " --live Connect to a live virtual machine\n"
- " -m|--mount dev[:mnt[:opts[:fstype]]]\n"
- " Mount dev on mnt (if omitted, /)\n"
- " --network Enable network\n"
- " -N|--new [filename=]type\n"
- " Create prepared disk (test<N>.img or filename)\n"
- " -n|--no-sync Don't autosync\n"
- " --no-dest-paths Don't tab-complete paths from guest fs\n"
- " --pipe-error Pipe commands can detect write errors\n"
- " --progress-bars Enable progress bars even when not interactive\n"
- " --no-progress-bars Disable progress bars\n"
- " --remote[=pid] Send commands to remote %s\n"
- " -r|--ro Mount read-only\n"
- " --selinux Enable SELinux support\n"
- " -v|--verbose Verbose messages\n"
- " -V|--version Display version and exit\n"
- " -w|--rw Mount read-write\n"
- " -x Echo each command before executing it\n"
- "\n"
- "To examine a disk image, ISO, hard disk, filesystem etc:\n"
- " %s [--ro|--rw] -i -a /path/to/disk.img\n"
- "or\n"
- " %s [--ro|--rw] -i -d name-of-libvirt-domain\n"
- "\n"
- "--ro recommended to avoid any writes to the disk image. If -i option fails\n"
- "run again without -i and use 'run' + 'list-filesystems' + 'mount' cmds.\n"
- "\n"
- "For more information, see the manpage %s(1).\n"),
+ printf (_("%s: guest filesystem shell\n"
+ "%s lets you edit virtual machine filesystems\n"
+ "Copyright (C) 2009-2015 Red Hat Inc.\n"
+ "Usage:\n"
+ " %s [--options] cmd [: cmd : cmd ...]\n"
+ "Options:\n"
+ " -h|--cmd-help List available commands\n"
+ " -h|--cmd-help cmd Display detailed help on 'cmd'\n"
+ " -a|--add image Add image\n"
+ " -c|--connect uri Specify libvirt URI for -d option\n"
+ " --csh Make --listen csh-compatible\n"
+ " -d|--domain guest Add disks from libvirt guest\n"
+ " --echo-keys Don't turn off echo for passphrases\n"
+ " -f|--file file Read commands from file\n"
+ " --format[=raw|..] Force disk format for -a option\n"
+ " -i|--inspector Automatically mount filesystems\n"
+ " --keys-from-stdin Read passphrases from stdin\n"
+ " --listen Listen for remote commands\n"
+ " --live Connect to a live virtual machine\n"
+ " -m|--mount dev[:mnt[:opts[:fstype]]]\n"
+ " Mount dev on mnt (if omitted, /)\n"
+ " --network Enable network\n"
+ " -N|--new [filename=]type\n"
+ " Create prepared disk (test<N>.img or filename)\n"
+ " -n|--no-sync Don't autosync\n"
+ " --no-dest-paths Don't tab-complete paths from guest fs\n"
+ " --pipe-error Pipe commands can detect write errors\n"
+ " --progress-bars Enable progress bars even when not interactive\n"
+ " --no-progress-bars Disable progress bars\n"
+ " --remote[=pid] Send commands to remote %s\n"
+ " -r|--ro Mount read-only\n"
+ " --selinux Enable SELinux support\n"
+ " -v|--verbose Verbose messages\n"
+ " -V|--version Display version and exit\n"
+ " -w|--rw Mount read-write\n"
+ " -x Echo each command before executing it\n"
+ "\n"
+ "To examine a disk image, ISO, hard disk, filesystem etc:\n"
+ " %s [--ro|--rw] -i -a /path/to/disk.img\n"
+ "or\n"
+ " %s [--ro|--rw] -i -d name-of-libvirt-domain\n"
+ "\n"
+ "--ro recommended to avoid any writes to the disk image. If -i option fails\n"
+ "run again without -i and use 'run' + 'list-filesystems' + 'mount' cmds.\n"
+ "\n"
+ "For more information, see the manpage %s(1).\n"),
guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name,
guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name,
guestfs_int_program_name);
diff --git a/format/format.c b/format/format.c
index d7d531a..ba8fe8c 100644
--- a/format/format.c
+++ b/format/format.c
@@ -65,29 +65,28 @@ usage (int status)
fprintf (stderr, _("Try `%s --help' for more information.\n%s\n"),
guestfs_int_program_name, warning);
else {
- fprintf (stdout,
- _("%s: erase and make a blank disk\n"
- "Copyright (C) 2012 Red Hat Inc.\n"
- "\n"
- "%s\n"
- "\n"
- "Usage:\n"
- " %s [--options] -a disk.img [-a disk.img ...]\n"
- "Options:\n"
- " -a|--add image Add image\n"
- " --filesystem=.. Create empty filesystem\n"
- " --format[=raw|..] Force disk format for -a option\n"
- " --help Display brief help\n"
- " --label=.. Set filesystem label\n"
- " --lvm=.. Create Linux LVM2 logical volume\n"
- " --partition=.. Create / set partition type\n"
- " -v|--verbose Verbose messages\n"
- " -V|--version Display version and exit\n"
- " --wipe Write zeroes over whole disk\n"
- " -x Trace libguestfs API calls\n"
- "For more information, see the manpage %s(1).\n"
- "\n"
- "%s\n\n"),
+ printf (_("%s: erase and make a blank disk\n"
+ "Copyright (C) 2012 Red Hat Inc.\n"
+ "\n"
+ "%s\n"
+ "\n"
+ "Usage:\n"
+ " %s [--options] -a disk.img [-a disk.img ...]\n"
+ "Options:\n"
+ " -a|--add image Add image\n"
+ " --filesystem=.. Create empty filesystem\n"
+ " --format[=raw|..] Force disk format for -a option\n"
+ " --help Display brief help\n"
+ " --label=.. Set filesystem label\n"
+ " --lvm=.. Create Linux LVM2 logical volume\n"
+ " --partition=.. Create / set partition type\n"
+ " -v|--verbose Verbose messages\n"
+ " -V|--version Display version and exit\n"
+ " --wipe Write zeroes over whole disk\n"
+ " -x Trace libguestfs API calls\n"
+ "For more information, see the manpage %s(1).\n"
+ "\n"
+ "%s\n\n"),
guestfs_int_program_name, warning, guestfs_int_program_name, guestfs_int_program_name,
warning);
}
diff --git a/fuse/guestmount.c b/fuse/guestmount.c
index 9853490..661d0b4 100644
--- a/fuse/guestmount.c
+++ b/fuse/guestmount.c
@@ -100,37 +100,36 @@ usage (int status)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
guestfs_int_program_name);
else {
- fprintf (stdout,
- _("%s: FUSE module for libguestfs\n"
- "%s lets you mount a virtual machine filesystem\n"
- "Copyright (C) 2009-2015 Red Hat Inc.\n"
- "Usage:\n"
- " %s [--options] mountpoint\n"
- "Options:\n"
- " -a|--add image Add image\n"
- " -c|--connect uri Specify libvirt URI for -d option\n"
- " --dir-cache-timeout Set readdir cache timeout (default 5 sec)\n"
- " -d|--domain guest Add disks from libvirt guest\n"
- " --echo-keys Don't turn off echo for passphrases\n"
- " --fd=FD Write to pipe FD when mountpoint is ready\n"
- " --format[=raw|..] Force disk format for -a option\n"
- " --fuse-help Display extra FUSE options\n"
- " -i|--inspector Automatically mount filesystems\n"
- " --help Display help message and exit\n"
- " --keys-from-stdin Read passphrases from stdin\n"
- " --live Connect to a live virtual machine\n"
- " -m|--mount dev[:mnt[:opts[:fstype]] Mount dev on mnt (if omitted, /)\n"
- " --no-fork Don't daemonize\n"
- " -n|--no-sync Don't autosync\n"
- " -o|--option opt Pass extra option to FUSE\n"
- " --pid-file filename Write PID to filename\n"
- " -r|--ro Mount read-only\n"
- " --selinux Enable SELinux support\n"
- " -v|--verbose Verbose messages\n"
- " -V|--version Display version and exit\n"
- " -w|--rw Mount read-write\n"
- " -x|--trace Trace guestfs API calls\n"
- ),
+ printf (_("%s: FUSE module for libguestfs\n"
+ "%s lets you mount a virtual machine filesystem\n"
+ "Copyright (C) 2009-2015 Red Hat Inc.\n"
+ "Usage:\n"
+ " %s [--options] mountpoint\n"
+ "Options:\n"
+ " -a|--add image Add image\n"
+ " -c|--connect uri Specify libvirt URI for -d option\n"
+ " --dir-cache-timeout Set readdir cache timeout (default 5 sec)\n"
+ " -d|--domain guest Add disks from libvirt guest\n"
+ " --echo-keys Don't turn off echo for passphrases\n"
+ " --fd=FD Write to pipe FD when mountpoint is ready\n"
+ " --format[=raw|..] Force disk format for -a option\n"
+ " --fuse-help Display extra FUSE options\n"
+ " -i|--inspector Automatically mount filesystems\n"
+ " --help Display help message and exit\n"
+ " --keys-from-stdin Read passphrases from stdin\n"
+ " --live Connect to a live virtual machine\n"
+ " -m|--mount dev[:mnt[:opts[:fstype]] Mount dev on mnt (if omitted, /)\n"
+ " --no-fork Don't daemonize\n"
+ " -n|--no-sync Don't autosync\n"
+ " -o|--option opt Pass extra option to FUSE\n"
+ " --pid-file filename Write PID to filename\n"
+ " -r|--ro Mount read-only\n"
+ " --selinux Enable SELinux support\n"
+ " -v|--verbose Verbose messages\n"
+ " -V|--version Display version and exit\n"
+ " -w|--rw Mount read-write\n"
+ " -x|--trace Trace guestfs API calls\n"
+ ),
guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name);
}
exit (status);
diff --git a/fuse/guestunmount.c b/fuse/guestunmount.c
index 9687401..c04cfad 100644
--- a/fuse/guestunmount.c
+++ b/fuse/guestunmount.c
@@ -52,20 +52,19 @@ usage (int status)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
guestfs_int_program_name);
else {
- fprintf (stdout,
- _("%s: clean up a mounted filesystem\n"
- "Copyright (C) 2013 Red Hat Inc.\n"
- "Usage:\n"
- " %s [--fd=FD] mountpoint\n"
- "Options:\n"
- " --fd=FD Pipe file descriptor to monitor\n"
- " --help Display help message and exit\n"
- " -q|--quiet Don't print fusermount errors\n"
- " --no-retry Don't retry fusermount\n"
- " --retry=N Retry fusermount N times (default: 5)\n"
- " -v|--verbose Verbose messages\n"
- " -V|--version Display version and exit\n"
- ),
+ printf (_("%s: clean up a mounted filesystem\n"
+ "Copyright (C) 2013 Red Hat Inc.\n"
+ "Usage:\n"
+ " %s [--fd=FD] mountpoint\n"
+ "Options:\n"
+ " --fd=FD Pipe file descriptor to monitor\n"
+ " --help Display help message and exit\n"
+ " -q|--quiet Don't print fusermount errors\n"
+ " --no-retry Don't retry fusermount\n"
+ " --retry=N Retry fusermount N times (default: 5)\n"
+ " -v|--verbose Verbose messages\n"
+ " -V|--version Display version and exit\n"
+ ),
guestfs_int_program_name, guestfs_int_program_name);
}
exit (status);
diff --git a/inspector/inspector.c b/inspector/inspector.c
index 70b7cd3..fd596b5 100644
--- a/inspector/inspector.c
+++ b/inspector/inspector.c
@@ -67,25 +67,24 @@ usage (int status)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
guestfs_int_program_name);
else {
- fprintf (stdout,
- _("%s: display information about a virtual machine\n"
- "Copyright (C) 2010 Red Hat Inc.\n"
- "Usage:\n"
- " %s [--options] -d domname file [file ...]\n"
- " %s [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
- "Options:\n"
- " -a|--add image Add image\n"
- " -c|--connect uri Specify libvirt URI for -d option\n"
- " -d|--domain guest Add disks from libvirt guest\n"
- " --echo-keys Don't turn off echo for passphrases\n"
- " --format[=raw|..] Force disk format for -a option\n"
- " --help Display brief help\n"
- " --keys-from-stdin Read passphrases from stdin\n"
- " -v|--verbose Verbose messages\n"
- " -V|--version Display version and exit\n"
- " -x Trace libguestfs API calls\n"
- " --xpath query Perform an XPath query\n"
- "For more information, see the manpage %s(1).\n"),
+ printf (_("%s: display information about a virtual machine\n"
+ "Copyright (C) 2010 Red Hat Inc.\n"
+ "Usage:\n"
+ " %s [--options] -d domname file [file ...]\n"
+ " %s [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
+ "Options:\n"
+ " -a|--add image Add image\n"
+ " -c|--connect uri Specify libvirt URI for -d option\n"
+ " -d|--domain guest Add disks from libvirt guest\n"
+ " --echo-keys Don't turn off echo for passphrases\n"
+ " --format[=raw|..] Force disk format for -a option\n"
+ " --help Display brief help\n"
+ " --keys-from-stdin Read passphrases from stdin\n"
+ " -v|--verbose Verbose messages\n"
+ " -V|--version Display version and exit\n"
+ " -x Trace libguestfs API calls\n"
+ " --xpath query Perform an XPath query\n"
+ "For more information, see the manpage %s(1).\n"),
guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name,
guestfs_int_program_name);
}
diff --git a/make-fs/make-fs.c b/make-fs/make-fs.c
index 980bfeb..67b0456 100644
--- a/make-fs/make-fs.c
+++ b/make-fs/make-fs.c
@@ -74,25 +74,24 @@ usage (int status)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
guestfs_int_program_name);
else {
- fprintf (stdout,
- _("%s: make a filesystem from a tar archive or files\n"
- "Copyright (C) 2010-2015 Red Hat Inc.\n"
- "Usage:\n"
- " %s [--options] input.tar output.img\n"
- " %s [--options] input.tar.gz output.img\n"
- " %s [--options] directory output.img\n"
- "Options:\n"
- " --floppy Make a virtual floppy disk\n"
- " --format=raw|qcow2|.. Set output format\n"
- " --help Display brief help\n"
- " --label=label Filesystem label\n"
- " --partition=mbr|gpt|.. Set partition type\n"
- " --size=size|+size Set size of output disk\n"
- " --type=ext4|.. Set filesystem type\n"
- " -v|--verbose Verbose messages\n"
- " -V|--version Display version and exit\n"
- " -x Trace libguestfs API calls\n"
- "For more information, see the manpage %s(1).\n"),
+ printf (_("%s: make a filesystem from a tar archive or files\n"
+ "Copyright (C) 2010-2015 Red Hat Inc.\n"
+ "Usage:\n"
+ " %s [--options] input.tar output.img\n"
+ " %s [--options] input.tar.gz output.img\n"
+ " %s [--options] directory output.img\n"
+ "Options:\n"
+ " --floppy Make a virtual floppy disk\n"
+ " --format=raw|qcow2|.. Set output format\n"
+ " --help Display brief help\n"
+ " --label=label Filesystem label\n"
+ " --partition=mbr|gpt|.. Set partition type\n"
+ " --size=size|+size Set size of output disk\n"
+ " --type=ext4|.. Set filesystem type\n"
+ " -v|--verbose Verbose messages\n"
+ " -V|--version Display version and exit\n"
+ " -x Trace libguestfs API calls\n"
+ "For more information, see the manpage %s(1).\n"),
guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name,
guestfs_int_program_name);
}
diff --git a/p2v/main.c b/p2v/main.c
index d59465a..83fcd8c 100644
--- a/p2v/main.c
+++ b/p2v/main.c
@@ -65,17 +65,16 @@ usage (int status)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
guestfs_int_program_name);
else {
- fprintf (stdout,
- _("%s: Convert a physical machine to use KVM\n"
- "Copyright (C) 2009-2015 Red Hat Inc.\n"
- "Usage:\n"
- " %s [--options]\n"
- "Options:\n"
- " --help Display brief help\n"
- " --cmdline=CMDLINE Used to debug command line parsing\n"
- " -v|--verbose Verbose messages\n"
- " -V|--version Display version and exit\n"
- "For more information, see the manpage %s(1).\n"),
+ printf (_("%s: Convert a physical machine to use KVM\n"
+ "Copyright (C) 2009-2015 Red Hat Inc.\n"
+ "Usage:\n"
+ " %s [--options]\n"
+ "Options:\n"
+ " --help Display brief help\n"
+ " --cmdline=CMDLINE Used to debug command line parsing\n"
+ " -v|--verbose Verbose messages\n"
+ " -V|--version Display version and exit\n"
+ "For more information, see the manpage %s(1).\n"),
guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name);
}
exit (status);
diff --git a/rescue/rescue.c b/rescue/rescue.c
index 9e0a516..f25a86b 100644
--- a/rescue/rescue.c
+++ b/rescue/rescue.c
@@ -56,31 +56,30 @@ usage (int status)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
guestfs_int_program_name);
else {
- fprintf (stdout,
- _("%s: Run a rescue shell on a virtual machine\n"
- "Copyright (C) 2009-2015 Red Hat Inc.\n"
- "Usage:\n"
- " %s [--options] -d domname\n"
- " %s [--options] -a disk.img [-a disk.img ...]\n"
- "Options:\n"
- " -a|--add image Add image\n"
- " --append kernelopts Append kernel options\n"
- " -c|--connect uri Specify libvirt URI for -d option\n"
- " -d|--domain guest Add disks from libvirt guest\n"
- " --format[=raw|..] Force disk format for -a option\n"
- " --help Display brief help\n"
- " -m|--memsize MB Set memory size in megabytes\n"
- " --network Enable network\n"
- " -r|--ro Access read-only\n"
- " --scratch[=N] Add scratch disk(s)\n"
- " --selinux Enable SELinux\n"
- " --smp N Enable SMP with N >= 2 virtual CPUs\n"
- " --suggest Suggest mount commands for this guest\n"
- " -v|--verbose Verbose messages\n"
- " -V|--version Display version and exit\n"
- " -w|--rw Mount read-write\n"
- " -x Trace libguestfs API calls\n"
- "For more information, see the manpage %s(1).\n"),
+ printf (_("%s: Run a rescue shell on a virtual machine\n"
+ "Copyright (C) 2009-2015 Red Hat Inc.\n"
+ "Usage:\n"
+ " %s [--options] -d domname\n"
+ " %s [--options] -a disk.img [-a disk.img ...]\n"
+ "Options:\n"
+ " -a|--add image Add image\n"
+ " --append kernelopts Append kernel options\n"
+ " -c|--connect uri Specify libvirt URI for -d option\n"
+ " -d|--domain guest Add disks from libvirt guest\n"
+ " --format[=raw|..] Force disk format for -a option\n"
+ " --help Display brief help\n"
+ " -m|--memsize MB Set memory size in megabytes\n"
+ " --network Enable network\n"
+ " -r|--ro Access read-only\n"
+ " --scratch[=N] Add scratch disk(s)\n"
+ " --selinux Enable SELinux\n"
+ " --smp N Enable SMP with N >= 2 virtual CPUs\n"
+ " --suggest Suggest mount commands for this guest\n"
+ " -v|--verbose Verbose messages\n"
+ " -V|--version Display version and exit\n"
+ " -w|--rw Mount read-write\n"
+ " -x Trace libguestfs API calls\n"
+ "For more information, see the manpage %s(1).\n"),
guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name,
guestfs_int_program_name);
}
--
2.5.0
2
3
This option was considered unsecure, found a fix on the generated
opensuse images instead.
---
customize/customize_run.ml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/customize/customize_run.ml b/customize/customize_run.ml
index ad0ab7f..6cb2328 100644
--- a/customize/customize_run.ml
+++ b/customize/customize_run.ml
@@ -116,7 +116,7 @@ exec >>%s 2>&1
| "yum" ->
sprintf "yum -y install %s" quoted_args
| "zypper" ->
- sprintf "zypper -n --gpg-auto-import-keys in -l %s" quoted_args
+ sprintf "zypper -n in -l %s" quoted_args
| "unknown" ->
error (f_"--install is not supported for this guest operating system")
| pm ->
@@ -143,7 +143,7 @@ exec >>%s 2>&1
| "yum" ->
sprintf "yum -y update"
| "zypper" ->
- sprintf "zypper -n --gpg-auto-import-keys update -l"
+ sprintf "zypper -n update -l"
| "unknown" ->
error (f_"--update is not supported for this guest operating system")
| pm ->
--
2.1.4
2
1
[PATCH 1/2] launch: direct: Use a single -machine [type, ]accel=... option.
by Richard W.M. Jones 02 Oct '15
by Richard W.M. Jones 02 Oct '15
02 Oct '15
Previously we used (on arm): -M virt -machine accel=...
After this change, we use: -machine virt,accel=...
On x86 there is no change.
The -M option is an abbreviation for -machine, and we can combine the
two options together. (Qemu combines the two options internally, but
it's more predictable if we do it ourselves).
Upstream qemu has supported the -machine option for over 5 years, and
in fact we implicitly relied on it (despite what the comment in the
code said).
---
src/launch-direct.c | 52 +++++++++++++++++++---------------------------------
1 file changed, 19 insertions(+), 33 deletions(-)
diff --git a/src/launch-direct.c b/src/launch-direct.c
index 44ae9d0..2ffbff1 100644
--- a/src/launch-direct.c
+++ b/src/launch-direct.c
@@ -376,11 +376,6 @@ launch_direct (guestfs_h *g, void *datav, const char *arg)
ADD_CMDLINE ("-display");
ADD_CMDLINE ("none");
-#ifdef MACHINE_TYPE
- ADD_CMDLINE ("-M");
- ADD_CMDLINE (MACHINE_TYPE);
-#endif
-
/* See guestfs.pod / gdb */
if (guestfs_int_get_backend_setting_bool (g, "gdb") > 0) {
ADD_CMDLINE ("-S");
@@ -388,35 +383,26 @@ launch_direct (guestfs_h *g, void *datav, const char *arg)
warning (g, "qemu debugging is enabled, connect gdb to tcp::1234 to begin");
}
+ ADD_CMDLINE ("-machine");
+ if (!force_tcg)
+ ADD_CMDLINE (
+#ifdef MACHINE_TYPE
+ MACHINE_TYPE ","
+#endif
+ "accel=kvm:tcg");
+ else
+ ADD_CMDLINE (
+#ifdef MACHINE_TYPE
+ MACHINE_TYPE ","
+#endif
+ "accel=tcg");
+
cpu_model = guestfs_int_get_cpu_model (has_kvm && !force_tcg);
if (cpu_model) {
ADD_CMDLINE ("-cpu");
ADD_CMDLINE (cpu_model);
}
- /* The qemu -machine option (added 2010-12) is a bit more sane
- * since it falls back through various different acceleration
- * modes, so try that first (thanks Markus Armbruster).
- */
- if (qemu_supports (g, data, "-machine")) {
- ADD_CMDLINE ("-machine");
- if (!force_tcg)
- ADD_CMDLINE ("accel=kvm:tcg");
- else
- ADD_CMDLINE ("accel=tcg");
- } else {
- /* qemu sometimes needs this option to enable hardware
- * virtualization, but some versions of 'qemu-kvm' will use KVM
- * regardless (even where this option appears in the help text).
- * It is rumoured that there are versions of qemu where
- * supplying this option when hardware virtualization is not
- * available will cause qemu to fail. A giant clusterfuck with
- * the qemu command line, again.
- */
- if (has_kvm && !force_tcg && qemu_supports (g, data, "-enable-kvm"))
- ADD_CMDLINE ("-enable-kvm");
- }
-
if (g->smp > 1) {
ADD_CMDLINE ("-smp");
ADD_CMDLINE_PRINTF ("%d", g->smp);
@@ -997,12 +983,12 @@ test_qemu (guestfs_h *g, struct backend_direct_data *data)
guestfs_int_cmd_add_arg (cmd3, g->hv);
guestfs_int_cmd_add_arg (cmd3, "-display");
guestfs_int_cmd_add_arg (cmd3, "none");
-#ifdef MACHINE_TYPE
- guestfs_int_cmd_add_arg (cmd3, "-M");
- guestfs_int_cmd_add_arg (cmd3, MACHINE_TYPE);
-#endif
guestfs_int_cmd_add_arg (cmd3, "-machine");
- guestfs_int_cmd_add_arg (cmd3, "accel=kvm:tcg");
+ guestfs_int_cmd_add_arg (cmd3,
+#ifdef MACHINE_TYPE
+ MACHINE_TYPE ","
+#endif
+ "accel=kvm:tcg");
guestfs_int_cmd_add_arg (cmd3, "-device");
guestfs_int_cmd_add_arg (cmd3, "?");
guestfs_int_cmd_clear_capture_errors (cmd3);
--
2.5.2
1
1
02 Oct '15
Traverse the po-docs directory before the subdirectories with translated
documentations, so we can make sure that libguestfs-docs.pot and the
translated .pod files have been generated. As a consequence of that,
when generating the translated manpages for documentations, all the
needed .pod files should be already there.
---
po-docs/Makefile.am | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/po-docs/Makefile.am b/po-docs/Makefile.am
index a274898..bf10558 100644
--- a/po-docs/Makefile.am
+++ b/po-docs/Makefile.am
@@ -41,7 +41,9 @@ CLEANFILES = po4a.conf
# language directory contains a Makefile.am that we need to keep up to
# date (note each $lang/Makefile.am should be identical).
# XXX Is there a better way?
-SUBDIRS = $(linguas)
+# The current directory is traversed first, to make sure that .pot and .pod
+# files are up-to-date and generated before applying translations in subdirs.
+SUBDIRS = . $(linguas)
update-po: libguestfs-docs.pot
@@ -88,3 +90,5 @@ podfiles: Makefile
for f in `cat $(top_srcdir)/po/POTFILES-pl`; do echo $(top_srcdir)/$$f; done >> $@-t
LC_ALL=C sort -o $@-t $@-t
mv $@-t $@
+
+all-local: update-po
--
2.1.0
2
4
- fix the syntax of hyperlinks
- replace the deprecation text with a simplier named list item, so it's
more visible
- use a named list item for the pointer to the C documentation of each
API
- add a named list item for the version of each API
---
generator/ruby.ml | 27 ++++++++++++++++-----------
1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/generator/ruby.ml b/generator/ruby.ml
index cd6678d..87bb34a 100644
--- a/generator/ruby.ml
+++ b/generator/ruby.ml
@@ -178,7 +178,7 @@ parse_flags (int argc, VALUE *argv)
* Guestfs::Guestfs.new([{:environment => false, :close_on_exit => false}]) -> Guestfs::Guestfs
*
* Call
- * +guestfs_create_flags+[http://libguestfs.org/guestfs.3.html#guestfs_create_flags]
+ * {guestfs_create_flags}[http://libguestfs.org/guestfs.3.html#guestfs_create_flags]
* to create a new libguestfs handle. The handle is represented in
* Ruby as an instance of the Guestfs::Guestfs class.
*/
@@ -235,7 +235,7 @@ ruby_guestfs_create (int argc, VALUE *argv, VALUE module)
* g.close() -> nil
*
* Call
- * +guestfs_close+[http://libguestfs.org/guestfs.3.html#guestfs_close]
+ * {guestfs_close}[http://libguestfs.org/guestfs.3.html#guestfs_close]
* to close the libguestfs handle.
*/
static VALUE
@@ -258,7 +258,7 @@ ruby_guestfs_close (VALUE gv)
* g.set_event_callback(cb, event_bitmask) -> event_handle
*
* Call
- * +guestfs_set_event_callback+[http://libguestfs.org/guestfs.3.html#guestfs_set_event_callback]
+ * {guestfs_set_event_callback}[http://libguestfs.org/guestfs.3.html#guestfs_set_event_callback]
* to register an event callback. This returns an event handle.
*/
static VALUE
@@ -297,7 +297,7 @@ ruby_set_event_callback (VALUE gv, VALUE cbv, VALUE event_bitmaskv)
* g.delete_event_callback(event_handle) -> nil
*
* Call
- * +guestfs_delete_event_callback+[http://libguestfs.org/guestfs.3.html#guestfs_delete_event_callback]
+ * {guestfs_delete_event_callback}[http://libguestfs.org/guestfs.3.html#guestfs_delete_event_callback]
* to delete an event callback.
*/
static VALUE
@@ -328,7 +328,7 @@ ruby_delete_event_callback (VALUE gv, VALUE event_handlev)
* Guestfs::Guestfs.event_to_string(events) -> string
*
* Call
- * +guestfs_event_to_string+[http://libguestfs.org/guestfs.3.html#guestfs_event_to_string]
+ * {guestfs_event_to_string}[http://libguestfs.org/guestfs.3.html#guestfs_event_to_string]
* to convert an event or event bitmask into a printable string.
*/
static VALUE
@@ -477,13 +477,18 @@ get_all_event_callbacks (guestfs_h *g, size_t *len_rtn)
if f.protocol_limit_warning then
doc ^ "\n\n" ^ protocol_limit_warning
else doc in
- let doc =
- match deprecation_notice f with
- | None -> doc
- | Some txt -> doc ^ "\n\n" ^ txt in
let doc = pod2text ~width:60 f.name doc in
let doc = String.concat "\n * " doc in
let doc = trim doc in
+ let doc =
+ match version_added f with
+ | None -> doc
+ | Some version -> doc ^ (sprintf "\n *\n * [Since] Added in version %s." version) in
+ let doc =
+ match f with
+ | { deprecated_by = None } -> doc
+ | { deprecated_by = Some alt } ->
+ doc ^ (sprintf "\n *\n * [Deprecated] In new code, use rdoc-ref:%s instead." alt) in
(* Because Ruby documentation appears as C comments, we must
* replace any instance of "/*".
@@ -518,8 +523,8 @@ get_all_event_callbacks (guestfs_h *g, size_t *len_rtn)
*
* %s
*
- * (For the C API documentation for this function, see
- * +guestfs_%s+[http://libguestfs.org/guestfs.3.html#guestfs_%s]).
+ * [C API] For the C API documentation for this function, see
+ * {guestfs_%s}[http://libguestfs.org/guestfs.3.html#guestfs_%s].
*/
" f.name args ret f.shortdesc doc f.name f.name
) else (
--
2.1.0
2
1
---
customize/password.ml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/customize/password.ml b/customize/password.ml
index 258d726..1f9b8fe 100644
--- a/customize/password.ml
+++ b/customize/password.ml
@@ -165,6 +165,9 @@ and default_crypto g root =
| "opensuse", v when v >= 11 -> `SHA512
| "opensuse", _ -> `MD5
+ | "sles", v when v >= 11 -> `SHA512
+ | "sles", _ -> `MD5
+
| _, _ ->
let minor = g#inspect_get_minor_version root in
warning (f_"password: using insecure md5 password encryption for guest of type %s version %d.%d.
--
2.1.4
1
0
[Sending the question to the proper mailing list]
On Thu, Oct 01, 2015 at 10:50:13AM +0100, slim tabka wrote:
> Hello Mr Richard Jones,
>
> First of all, thank you for the amazing tools that you are creating.
> I'm new to the virtualization and libguestfs ,so I'm hoping you can help me
> to at least understand what's the problem I'm having exactly or to know if
> there's a way to resolve it , and any suggestion or advice is much
> appreciated.
>
> I have a problem while trying to create a vm (the method I'm using is to
> copy the filesystem of a template in a newly created lvm device and I
> modify the fstab file and grub.conf with the uuid of the newely created
> device) but the vm get stuck in booting from hard disk , while using xen I
> switched the vm to a pv guest and used pygrub and now the vm is working
> properly , the problem is with kvm (installed on ubuntu 14.04) the vm
> (centos guest) is always stuck in the booting and didn't find a tool like
> pygrub on kvm , the only way to make the vm work is to manually install
> grub through a livecd, I thought of using guestfish and use grub-install /
> /dev/sda but when I try to start the vm it is stuck in grub2.0.2 shell.
> It seems that with grub-install with guestfish it installed grub2 but in
> the man page of guestfish it's said that it only install grub1.
>
> So is it because kvm is installed on ubuntu that's why grub-install
> installs grub2?? and if the host is centos , wil I have problems with
> ubuntu guests while tring to install grub ??? So why even if I modified the
> /boot/grub/grub.conf inside the guest it still don't want to boot?? if the
> host is kvm on ubuntu will I have problems with centos guest and if the
> host is centos will I have problems with ubuntu guest??
> I'm really confused wth all this , I don't know if I'm missing something.
>
> I'm not sure if I was clear enough , and if needed I can provide you more
> infos , but it's been a while that I'm stuck so any suggestion will be more
> than welcome , so thank you for your time and I hope I'm not bothering you.
>
> Slim TABKA
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW
1
1
Adding missing opensuse.gpg to EXTRA_DIST.
---
builder/Makefile.am | 1 +
1 file changed, 1 insertion(+)
diff --git a/builder/Makefile.am b/builder/Makefile.am
index 3111ef2..0d5ce3b 100644
--- a/builder/Makefile.am
+++ b/builder/Makefile.am
@@ -22,6 +22,7 @@ AM_YFLAGS = -d
EXTRA_DIST = \
$(SOURCES_MLI) $(SOURCES_ML) $(SOURCES_C) \
libguestfs.gpg \
+ opensuse.gpg \
test-index \
test-simplestreams/streams/v1/index.json \
test-simplestreams/streams/v1/net.cirros-cloud_released_download.json \
--
2.1.4
1
0
Using 'ocamlfind ocamldoc' is much faster than running 'ocamldoc'
directly, because ocamlfind will run the native code program
'ocamldoc.opt' if it is available.
This change approximately halves the time taken to compile the ocaml
bindings.
---
ocaml/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am
index a535b43..b9828e1 100644
--- a/ocaml/Makefile.am
+++ b/ocaml/Makefile.am
@@ -98,7 +98,7 @@ if HAVE_OCAMLDOC
noinst_DATA += html/index.html
html/index.html: $(srcdir)/guestfs.mli $(srcdir)/guestfs.ml
- -$(OCAMLDOC) -d html -html $^
+ -$(OCAMLFIND) ocamldoc -d html -html $^
endif
--
2.5.0
2
4